1
Fork 0

Stabilize Vec(Deque)::resize_with

Closes #41758
This commit is contained in:
Scott McMurray 2018-12-19 22:00:25 -08:00
parent daa8792f17
commit 7b6cf6e87b
3 changed files with 2 additions and 7 deletions

View file

@ -1241,8 +1241,6 @@ impl<T> Vec<T> {
/// # Examples
///
/// ```
/// #![feature(vec_resize_with)]
///
/// let mut vec = vec![1, 2, 3];
/// vec.resize_with(5, Default::default);
/// assert_eq!(vec, [1, 2, 3, 0, 0]);
@ -1255,7 +1253,7 @@ impl<T> Vec<T> {
///
/// [`resize`]: #method.resize
/// [`Clone`]: ../../std/clone/trait.Clone.html
#[unstable(feature = "vec_resize_with", issue = "41758")]
#[stable(feature = "vec_resize_with", since = "1.33.0")]
pub fn resize_with<F>(&mut self, new_len: usize, f: F)
where F: FnMut() -> T
{