Skip to content

Commit 995238c

Browse files
committed
[Clippy] Swap unnecessary_to_owned to use diagnostic item instead of path
1 parent c1a4a69 commit 995238c

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

alloc/src/string.rs

+1
Original file line numberDiff line numberDiff line change
@@ -571,6 +571,7 @@ impl String {
571571
/// [`into_bytes`]: String::into_bytes
572572
#[inline]
573573
#[stable(feature = "rust1", since = "1.0.0")]
574+
#[cfg_attr(not(test), rustc_diagnostic_item = "string_from_utf8")]
574575
pub fn from_utf8(vec: Vec<u8>) -> Result<String, FromUtf8Error> {
575576
match str::from_utf8(&vec) {
576577
Ok(..) => Ok(String { vec }),

0 commit comments

Comments
 (0)