Skip to content

Commit

Permalink
type annotate &str when stack allocating a string
Browse files Browse the repository at this point in the history
  • Loading branch information
ismailmaj committed Nov 21, 2022
1 parent 101e182 commit 005c6df
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 005c6df

Please sign in to comment.