@@ -1212,8 +1212,9 @@ impl<T: Clone> Vec<T> {
1212
1212
/// difference, with each additional slot filled with `value`.
1213
1213
/// If `new_len` is less than `len`, the `Vec` is simply truncated.
1214
1214
///
1215
- /// This method requires `Clone` to clone the passed value. If you'd
1216
- /// rather create a value with `Default` instead, see [`resize_default`].
1215
+ /// This method requires [`Clone`] to be able clone the passed value. If
1216
+ /// you'd rather create a value with [`Default`] instead, see
1217
+ /// [`resize_default`].
1217
1218
///
1218
1219
/// # Examples
1219
1220
///
@@ -1227,6 +1228,8 @@ impl<T: Clone> Vec<T> {
1227
1228
/// assert_eq!(vec, [1, 2]);
1228
1229
/// ```
1229
1230
///
1231
+ /// [`Clone`]: ../../std/clone/trait.Clone.html
1232
+ /// [`Default`]: ../../std/default/trait.Default.html
1230
1233
/// [`resize_default`]: #method.resize_default
1231
1234
#[ stable( feature = "vec_resize" , since = "1.5.0" ) ]
1232
1235
pub fn resize ( & mut self , new_len : usize , value : T ) {
@@ -1244,7 +1247,7 @@ impl<T: Clone> Vec<T> {
1244
1247
/// Iterates over the slice `other`, clones each element, and then appends
1245
1248
/// it to this `Vec`. The `other` vector is traversed in-order.
1246
1249
///
1247
- /// Note that this function is same as `extend` except that it is
1250
+ /// Note that this function is same as [ `extend`] except that it is
1248
1251
/// specialized to work with slices instead. If and when Rust gets
1249
1252
/// specialization this function will likely be deprecated (but still
1250
1253
/// available).
@@ -1256,6 +1259,8 @@ impl<T: Clone> Vec<T> {
1256
1259
/// vec.extend_from_slice(&[2, 3, 4]);
1257
1260
/// assert_eq!(vec, [1, 2, 3, 4]);
1258
1261
/// ```
1262
+ ///
1263
+ /// [`extend`]: #method.extend
1259
1264
#[ stable( feature = "vec_extend_from_slice" , since = "1.6.0" ) ]
1260
1265
pub fn extend_from_slice ( & mut self , other : & [ T ] ) {
1261
1266
self . spec_extend ( other. iter ( ) )
@@ -1266,12 +1271,11 @@ impl<T: Default> Vec<T> {
1266
1271
/// Resizes the `Vec` in-place so that `len` is equal to `new_len`.
1267
1272
///
1268
1273
/// If `new_len` is greater than `len`, the `Vec` is extended by the
1269
- /// difference, with each additional slot filled with `Default::default()`.
1274
+ /// difference, with each additional slot filled with [ `Default::default()`] .
1270
1275
/// If `new_len` is less than `len`, the `Vec` is simply truncated.
1271
1276
///
1272
- /// This method uses `Default` to create new values on every push. If
1273
- /// you'd rather `Clone` a given value, use [`resize`].
1274
- ///
1277
+ /// This method uses [`Default`] to create new values on every push. If
1278
+ /// you'd rather [`Clone`] a given value, use [`resize`].
1275
1279
///
1276
1280
/// # Examples
1277
1281
///
@@ -1288,6 +1292,9 @@ impl<T: Default> Vec<T> {
1288
1292
/// ```
1289
1293
///
1290
1294
/// [`resize`]: #method.resize
1295
+ /// [`Default::default()`]: ../../std/default/trait.Default.html#tymethod.default
1296
+ /// [`Default`]: ../../std/default/trait.Default.html
1297
+ /// [`Clone`]: ../../std/clone/trait.Clone.html
1291
1298
#[ unstable( feature = "vec_resize_default" , issue = "41758" ) ]
1292
1299
pub fn resize_default ( & mut self , new_len : usize ) {
1293
1300
let len = self . len ( ) ;
0 commit comments