Skip to content

Commit 758aff7

Browse files
committed
Update note to include recommendation to use .as_slice()
1 parent 91a2c25 commit 758aff7

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/libstd/primitive_docs.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -387,7 +387,8 @@ mod prim_slice { }
387387
/// [`len()`]: #method.len
388388
///
389389
/// Note: This example shows the internals of `&str`. `unsafe` should not be
390-
/// used to get a string slice under normal circumstances.
390+
/// used to get a string slice under normal circumstances. Use `.as_slice()`
391+
/// instead.
391392
mod prim_str { }
392393

393394
#[doc(primitive = "tuple")]

0 commit comments

Comments
 (0)