/// assert!(Some('ע') == s.trim_left().chars().next());
/// ```
#[stable(feature = "rust1", since = "1.0.0")]
- #[rustc_deprecated(reason = "superseded by `trim_start`", since = "1.33.0")]
+ #[rustc_deprecated(
+ since = "1.33.0",
+ reason = "superseded by `trim_start`",
+ suggestion = "trim_start",
+ )]
pub fn trim_left(&self) -> &str {
self.trim_start()
}
/// assert!(Some('ת') == s.trim_right().chars().rev().next());
/// ```
#[stable(feature = "rust1", since = "1.0.0")]
- #[rustc_deprecated(reason = "superseded by `trim_end`", since = "1.33.0")]
+ #[rustc_deprecated(
+ since = "1.33.0",
+ reason = "superseded by `trim_end`",
+ suggestion = "trim_end",
+ )]
pub fn trim_right(&self) -> &str {
self.trim_end()
}
/// assert_eq!("12foo1bar12".trim_left_matches(x), "foo1bar12");
/// ```
#[stable(feature = "rust1", since = "1.0.0")]
- #[rustc_deprecated(reason = "superseded by `trim_start_matches`", since = "1.33.0")]
+ #[rustc_deprecated(
+ since = "1.33.0",
+ reason = "superseded by `trim_start_matches`",
+ suggestion = "trim_start_matches",
+ )]
pub fn trim_left_matches<'a, P: Pattern<'a>>(&'a self, pat: P) -> &'a str {
self.trim_start_matches(pat)
}
/// assert_eq!("1fooX".trim_right_matches(|c| c == '1' || c == 'X'), "1foo");
/// ```
#[stable(feature = "rust1", since = "1.0.0")]
- #[rustc_deprecated(reason = "superseded by `trim_end_matches`", since = "1.33.0")]
+ #[rustc_deprecated(
+ since = "1.33.0",
+ reason = "superseded by `trim_end_matches`",
+ suggestion = "trim_end_matches",
+ )]
pub fn trim_right_matches<'a, P: Pattern<'a>>(&'a self, pat: P) -> &'a str
where P::Searcher: ReverseSearcher<'a>
{