From 995238ce3f5ad90c38fba07b70dfbdb1608ccc98 Mon Sep 17 00:00:00 2001 From: GnomedDev Date: Wed, 18 Sep 2024 22:10:05 +0100 Subject: [PATCH] [Clippy] Swap `unnecessary_to_owned` to use diagnostic item instead of path --- alloc/src/string.rs | 1 + 1 file changed, 1 insertion(+) diff --git a/alloc/src/string.rs b/alloc/src/string.rs index c7e9931ed2a5a..0bad33c909d61 100644 --- a/alloc/src/string.rs +++ b/alloc/src/string.rs @@ -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) -> Result { match str::from_utf8(&vec) { Ok(..) => Ok(String { vec }),