Skip to content

Commit

Permalink
[Clippy] Swap manual_strip to use diagnostic items instead of paths
Browse files Browse the repository at this point in the history
  • Loading branch information
GnomedDev committed Sep 19, 2024
1 parent 995238c commit 9edfe1d
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions core/src/str/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down Expand Up @@ -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)
}
Expand All @@ -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>,
Expand Down

0 comments on commit 9edfe1d

Please sign in to comment.