Stabilize core::slice::fill_with
This commit is contained in:
parent
18ec4a9a74
commit
b50df6d31c
1 changed files with 2 additions and 3 deletions
|
|
@ -2706,13 +2706,12 @@ impl<T> [T] {
|
|||
/// # Examples
|
||||
///
|
||||
/// ```
|
||||
/// #![feature(slice_fill_with)]
|
||||
///
|
||||
/// let mut buf = vec![1; 10];
|
||||
/// buf.fill_with(Default::default);
|
||||
/// assert_eq!(buf, vec![0; 10]);
|
||||
/// ```
|
||||
#[unstable(feature = "slice_fill_with", issue = "79221")]
|
||||
#[doc(alias = "memset")]
|
||||
#[stable(feature = "slice_fill_with", since = "1.51.0")]
|
||||
pub fn fill_with<F>(&mut self, mut f: F)
|
||||
where
|
||||
F: FnMut() -> T,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue