From 6906fa9d9f53bb8c93e39723b89696be1de13a20 Mon Sep 17 00:00:00 2001 From: GnomedDev Date: Wed, 18 Sep 2024 21:37:12 +0100 Subject: [PATCH] [Clippy] Swap `single_char_add_str`/`format_push_string` to use diagnostic items instead of paths --- alloc/src/string.rs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/alloc/src/string.rs b/alloc/src/string.rs index a2c70de3ed0e9..c7e9931ed2a5a 100644 --- a/alloc/src/string.rs +++ b/alloc/src/string.rs @@ -1113,6 +1113,7 @@ impl String { #[inline] #[stable(feature = "rust1", since = "1.0.0")] #[rustc_confusables("append", "push")] + #[cfg_attr(not(test), rustc_diagnostic_item = "string_push_str")] pub fn push_str(&mut self, string: &str) { self.vec.extend_from_slice(string.as_bytes()) } @@ -1747,6 +1748,7 @@ impl String { #[cfg(not(no_global_oom_handling))] #[inline] #[stable(feature = "insert_str", since = "1.16.0")] + #[cfg_attr(not(test), rustc_diagnostic_item = "string_insert_str")] pub fn insert_str(&mut self, idx: usize, string: &str) { assert!(self.is_char_boundary(idx));