Skip to content

Commit

Permalink
Replace use of deprecated trim_left_matches with trim_start_matches
Browse files Browse the repository at this point in the history
  • Loading branch information
dtolnay committed Mar 8, 2023
1 parent 88d73e5 commit 1c5ea24
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 10 deletions.
6 changes: 1 addition & 5 deletions serde_derive/src/dummy.rs
Original file line number Diff line number Diff line change
Expand Up @@ -39,10 +39,6 @@ pub fn wrap_in_const(
}
}

#[allow(deprecated)]
fn unraw(ident: &Ident) -> String {
// str::trim_start_matches was added in 1.30, trim_left_matches deprecated
// in 1.33. We currently support rustc back to 1.15 so we need to continue
// to use the deprecated one.
ident.to_string().trim_left_matches("r#").to_owned()
ident.to_string().trim_start_matches("r#").to_owned()
}
6 changes: 1 addition & 5 deletions serde_derive/src/internals/attr.rs
Original file line number Diff line number Diff line change
Expand Up @@ -141,12 +141,8 @@ pub struct Name {
deserialize_aliases: Vec<String>,
}

#[allow(deprecated)]
fn unraw(ident: &Ident) -> String {
// str::trim_start_matches was added in 1.30, trim_left_matches deprecated
// in 1.33. We currently support rustc back to 1.15 so we need to continue
// to use the deprecated one.
ident.to_string().trim_left_matches("r#").to_owned()
ident.to_string().trim_start_matches("r#").to_owned()
}

impl Name {
Expand Down

0 comments on commit 1c5ea24

Please sign in to comment.