diff options
| author | GnomedDev <david2005thomas@gmail.com> | 2024-09-18 22:13:50 +0100 |
|---|---|---|
| committer | GnomedDev <david2005thomas@gmail.com> | 2024-09-19 13:13:43 +0100 |
| commit | 5f42ae13c1f5b99cb35aadb4c20376ba64e69ffb (patch) | |
| tree | c1a36a8923d3178a1ecffdee48d1f0ba0ed4aff4 /library | |
| parent | 89532c0f30ab781351c1cfc59ad155a25ca4e102 (diff) | |
| download | rust-5f42ae13c1f5b99cb35aadb4c20376ba64e69ffb.tar.gz rust-5f42ae13c1f5b99cb35aadb4c20376ba64e69ffb.zip | |
[Clippy] Swap `manual_strip` to use diagnostic items instead of paths
Diffstat (limited to 'library')
| -rw-r--r-- | library/core/src/str/mod.rs | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/library/core/src/str/mod.rs b/library/core/src/str/mod.rs index 9373d807f44..712bf011c27 100644 --- a/library/core/src/str/mod.rs +++ b/library/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<P: Pattern>(&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<P: Pattern>(&self, pat: P) -> bool where for<'a> P::Searcher<'a>: ReverseSearcher<'a>, |
