Skip to content

Commit

Permalink
[Clippy] Swap unnecessary_to_owned to use diagnostic item instead o…
Browse files Browse the repository at this point in the history
…f path
  • Loading branch information
GnomedDev committed Sep 19, 2024
1 parent c1a4a69 commit 995238c
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions alloc/src/string.rs
Original file line number Diff line number Diff line change
Expand Up @@ -571,6 +571,7 @@ impl String {
/// [`into_bytes`]: String::into_bytes
#[inline]
#[stable(feature = "rust1", since = "1.0.0")]
#[cfg_attr(not(test), rustc_diagnostic_item = "string_from_utf8")]
pub fn from_utf8(vec: Vec<u8>) -> Result<String, FromUtf8Error> {
match str::from_utf8(&vec) {
Ok(..) => Ok(String { vec }),
Expand Down

0 comments on commit 995238c

Please sign in to comment.