Work around deprecation of str::trim_left_matches

This commit is contained in:
David Tolnay
2018-12-27 15:20:32 -05:00
parent 5c24f0f0f3
commit c6c1d8fa86
5 changed files with 41 additions and 38 deletions
+4
View File
@@ -95,7 +95,11 @@ pub struct Name {
deserialize: 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()
}