File tree 2 files changed +23
-2
lines changed
2 files changed +23
-2
lines changed Original file line number Diff line number Diff line change @@ -393,7 +393,12 @@ impl<T> [T] {
393
393
}
394
394
395
395
/// Returns a reference to an element or subslice, without doing bounds
396
- /// checking. So use it very carefully!
396
+ /// checking.
397
+ ///
398
+ /// This is generally not recommended, use with caution! For a safe
399
+ /// alternative see [`get`].
400
+ ///
401
+ /// [`get`]: #method.get
397
402
///
398
403
/// # Examples
399
404
///
@@ -413,7 +418,12 @@ impl<T> [T] {
413
418
}
414
419
415
420
/// Returns a mutable reference to an element or subslice, without doing
416
- /// bounds checking. So use it very carefully!
421
+ /// bounds checking.
422
+ ///
423
+ /// This is generally not recommended, use with caution! For a safe
424
+ /// alternative see [`get_mut`].
425
+ ///
426
+ /// [`get_mut`]: #method.get_mut
417
427
///
418
428
/// # Examples
419
429
///
Original file line number Diff line number Diff line change @@ -435,6 +435,12 @@ impl str {
435
435
/// Creates a string slice from another string slice, bypassing safety
436
436
/// checks.
437
437
///
438
+ /// This is generally not recommended, use with caution! For a safe
439
+ /// alternative see [`str`] and [`Index`].
440
+ ///
441
+ /// [`str`]: primitive.str.html
442
+ /// [`Index`]: ops/trait.Index.html
443
+ ///
438
444
/// This new slice goes from `begin` to `end`, including `begin` but
439
445
/// excluding `end`.
440
446
///
@@ -477,6 +483,11 @@ impl str {
477
483
478
484
/// Creates a string slice from another string slice, bypassing safety
479
485
/// checks.
486
+ /// This is generally not recommended, use with caution! For a safe
487
+ /// alternative see [`str`] and [`IndexMut`].
488
+ ///
489
+ /// [`str`]: primitive.str.html
490
+ /// [`IndexMut`]: ops/trait.IndexMut.html
480
491
///
481
492
/// This new slice goes from `begin` to `end`, including `begin` but
482
493
/// excluding `end`.
You can’t perform that action at this time.
0 commit comments