Skip to content

Commit

Permalink
Rollup merge of rust-lang#104436 - ismailmaj:add-slice-to-stack-alloc…
Browse files Browse the repository at this point in the history
…ated-string-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 authored Nov 29, 2022
2 parents e0098a5 + 005c6df commit 439eaed
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 439eaed

Please sign in to comment.