Skip to content

Commit 632db79

Browse files
Apply suggestions from code review
1 parent 11f6979 commit 632db79

File tree

1 file changed

+12
-13
lines changed

1 file changed

+12
-13
lines changed

library/alloc/src/vec.rs

+12-13
Original file line numberDiff line numberDiff line change
@@ -368,7 +368,7 @@ impl<T> Vec<T> {
368368
/// into a `Vec` with the [`from_raw_parts`] function, allowing
369369
/// the destructor to perform the cleanup.
370370
///
371-
/// [`from_raw_parts`]: #method.from_raw_parts
371+
/// [`from_raw_parts`]: Vec::from_raw_parts
372372
///
373373
/// # Examples
374374
///
@@ -722,8 +722,8 @@ impl<T> Vec<T> {
722722
/// assert_eq!(vec, []);
723723
/// ```
724724
///
725-
/// [`clear`]: #method.clear
726-
/// [`drain`]: #method.drain
725+
/// [`clear`]: Vec::clear
726+
/// [`drain`]: Vec::drain
727727
#[stable(feature = "rust1", since = "1.0.0")]
728728
pub fn truncate(&mut self, len: usize) {
729729
// This is safe because:
@@ -802,7 +802,7 @@ impl<T> Vec<T> {
802802
/// }
803803
/// ```
804804
///
805-
/// [`as_mut_ptr`]: #method.as_mut_ptr
805+
/// [`as_mut_ptr`]: Vec::as_mut_ptr
806806
#[stable(feature = "vec_as_ptr", since = "1.37.0")]
807807
#[inline]
808808
pub fn as_ptr(&self) -> *const T {
@@ -858,17 +858,17 @@ impl<T> Vec<T> {
858858
/// is done using one of the safe operations instead, such as
859859
/// [`truncate`], [`resize`], [`extend`], or [`clear`].
860860
///
861-
/// [`truncate`]: #method.truncate
862-
/// [`resize`]: #method.resize
861+
/// [`truncate`]: Vec::truncate
862+
/// [`resize`]: Vec::resize
863863
/// [`extend`]: Extend::extend
864-
/// [`clear`]: #method.clear
864+
/// [`clear`]: Vec::clear
865865
///
866866
/// # Safety
867867
///
868868
/// - `new_len` must be less than or equal to [`capacity()`].
869869
/// - The elements at `old_len..new_len` must be initialized.
870870
///
871-
/// [`capacity()`]: #method.capacity
871+
/// [`capacity()`]: Vec::capacity
872872
///
873873
/// # Examples
874874
///
@@ -1470,7 +1470,7 @@ impl<T> Vec<T> {
14701470
/// assert_eq!(vec, [2, 4, 8, 16]);
14711471
/// ```
14721472
///
1473-
/// [`resize`]: #method.resize
1473+
/// [`resize`]: Vec::resize
14741474
#[stable(feature = "vec_resize_with", since = "1.33.0")]
14751475
pub fn resize_with<F>(&mut self, new_len: usize, f: F)
14761476
where
@@ -1521,7 +1521,7 @@ impl<T> Vec<T> {
15211521
/// reading from a file) before marking the data as initialized using the
15221522
/// [`set_len`] method.
15231523
///
1524-
/// [`set_len`]: #method.set_len
1524+
/// [`set_len`]: Vec::set_len
15251525
///
15261526
/// # Examples
15271527
///
@@ -1580,7 +1580,7 @@ impl<T: Clone> Vec<T> {
15801580
/// assert_eq!(vec, [1, 2]);
15811581
/// ```
15821582
///
1583-
/// [`resize_with`]: #method.resize_with
1583+
/// [`resize_with`]: Vec::resize_with
15841584
#[stable(feature = "vec_resize", since = "1.5.0")]
15851585
pub fn resize(&mut self, new_len: usize, value: T) {
15861586
let len = self.len();
@@ -1642,8 +1642,7 @@ impl<T: Default> Vec<T> {
16421642
/// assert_eq!(vec, [1, 2]);
16431643
/// ```
16441644
///
1645-
/// [`resize`]: #method.resize
1646-
/// [`Default::default()`]: Default::default
1645+
/// [`resize`]: Vec::resize
16471646
#[unstable(feature = "vec_resize_default", issue = "41758")]
16481647
#[rustc_deprecated(
16491648
reason = "This is moving towards being removed in favor \

0 commit comments

Comments
 (0)