From 9edfe1dc97f2fa74a156f5bda1b7ad3ef0770243 Mon Sep 17 00:00:00 2001 From: GnomedDev Date: Wed, 18 Sep 2024 22:13:50 +0100 Subject: [PATCH] [Clippy] Swap `manual_strip` to use diagnostic items instead of paths --- core/src/str/mod.rs | 3 +++ 1 file changed, 3 insertions(+) diff --git a/core/src/str/mod.rs b/core/src/str/mod.rs index 9373d807f44e3..712bf011c273e 100644 --- a/core/src/str/mod.rs +++ b/core/src/str/mod.rs @@ -134,6 +134,7 @@ impl str { /// ``` #[stable(feature = "rust1", since = "1.0.0")] #[rustc_const_stable(feature = "const_str_len", since = "1.39.0")] + #[cfg_attr(not(test), rustc_diagnostic_item = "str_len")] #[must_use] #[inline] pub const fn len(&self) -> usize { @@ -1157,6 +1158,7 @@ impl str { /// assert!(bananas.starts_with(&['a', 'b', 'c', 'd'])); /// ``` #[stable(feature = "rust1", since = "1.0.0")] + #[cfg_attr(not(test), rustc_diagnostic_item = "str_starts_with")] pub fn starts_with(&self, pat: P) -> bool { pat.is_prefix_of(self) } @@ -1181,6 +1183,7 @@ impl str { /// assert!(!bananas.ends_with("nana")); /// ``` #[stable(feature = "rust1", since = "1.0.0")] + #[cfg_attr(not(test), rustc_diagnostic_item = "str_ends_with")] pub fn ends_with(&self, pat: P) -> bool where for<'a> P::Searcher<'a>: ReverseSearcher<'a>,