Rollup merge of #35610 - JessRudder:33637-doc-update-for-str-representaton, r=steveklabnik
Add note to docs for &str that example is to demo internals only r? @steveklabnik This adds a note below the &str representation example explaining that the example provided should not be used under normal circumstances.. Would it make sense to point people in the direction of the method(s) they should use instead? I left it out in the interest of not complicating the documentation, but, there's definitely an argument to be made for adding a bit of guidance in there.
This commit is contained in:
commit
997a248c01
@ -385,6 +385,10 @@ mod prim_slice { }
|
||||
///
|
||||
/// [`.as_ptr()`]: #method.as_ptr
|
||||
/// [`len()`]: #method.len
|
||||
///
|
||||
/// Note: This example shows the internals of `&str`. `unsafe` should not be
|
||||
/// used to get a string slice under normal circumstances. Use `.as_slice()`
|
||||
/// instead.
|
||||
mod prim_str { }
|
||||
|
||||
#[doc(primitive = "tuple")]
|
||||
|
Loading…
Reference in New Issue
Block a user