Skip to content

Commit

Permalink
Stabilize core::slice::fill_with
Browse files Browse the repository at this point in the history
  • Loading branch information
yoshuawuyts committed Jan 15, 2021
1 parent 18ec4a9 commit b50df6d
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions library/core/src/slice/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down

0 comments on commit b50df6d

Please sign in to comment.