Skip to content

Commit

Permalink
Rollup merge of #104436 - ismailmaj:add-slice-to-stack-allocated-stri…
Browse files Browse the repository at this point in the history
…ng-comment, r=Mark-Simulacrum

Add slice to the stack allocated string comment

Precise that the "stack allocated string" is not a string but a string slice.

``@rustbot`` label +A-docs
  • Loading branch information
matthiaskrgr committed Nov 29, 2022
2 parents d88699f + 005c6df commit e4d1fe7
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion library/core/src/str/converts.rs
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ use super::Utf8Error;
/// let sparkle_heart = [240, 159, 146, 150];
///
/// // We know these bytes are valid, so just use `unwrap()`.
/// let sparkle_heart = str::from_utf8(&sparkle_heart).unwrap();
/// let sparkle_heart: &str = str::from_utf8(&sparkle_heart).unwrap();
///
/// assert_eq!("💖", sparkle_heart);
/// ```
Expand Down

0 comments on commit e4d1fe7

Please sign in to comment.