1
Fork 0

Use explicit intra-doc link in path for Vec resize

This commit is contained in:
Ivan Tham 2020-08-29 20:40:05 +08:00 committed by GitHub
parent 65d071eeb5
commit 237c5005d6
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -1567,7 +1567,7 @@ impl<T: Clone> Vec<T> {
/// This method requires `T` to implement [`Clone`], /// This method requires `T` to implement [`Clone`],
/// in order to be able to clone the passed value. /// in order to be able to clone the passed value.
/// If you need more flexibility (or want to rely on [`Default`] instead of /// If you need more flexibility (or want to rely on [`Default`] instead of
/// [`Clone`]), use [`resize_with`]. /// [`Clone`]), use [`Vec::resize_with`].
/// ///
/// # Examples /// # Examples
/// ///
@ -1580,8 +1580,6 @@ impl<T: Clone> Vec<T> {
/// vec.resize(2, 0); /// vec.resize(2, 0);
/// assert_eq!(vec, [1, 2]); /// assert_eq!(vec, [1, 2]);
/// ``` /// ```
///
/// [`resize_with`]: Vec::resize_with
#[stable(feature = "vec_resize", since = "1.5.0")] #[stable(feature = "vec_resize", since = "1.5.0")]
pub fn resize(&mut self, new_len: usize, value: T) { pub fn resize(&mut self, new_len: usize, value: T) {
let len = self.len(); let len = self.len();