[Clippy] Swap manual_strip to use diagnostic items instead of paths
This commit is contained in:
@@ -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>,
|
||||
|
||||
Reference in New Issue
Block a user