@@ -699,7 +699,7 @@ impl LintPass for UnusedAttributes {
699
699
700
700
if !attr:: is_used ( attr) {
701
701
cx. span_lint ( UNUSED_ATTRIBUTES , attr. span , "unused attribute" ) ;
702
- if CRATE_ATTRS . contains ( & attr. name ( ) . get ( ) ) {
702
+ if CRATE_ATTRS . contains ( & & attr. name ( ) [ ] ) {
703
703
let msg = match attr. node . style {
704
704
ast:: AttrOuter => "crate-level attribute should be an inner \
705
705
attribute: add an exclamation mark: #![foo]",
@@ -801,10 +801,10 @@ impl LintPass for UnusedResults {
801
801
None => { }
802
802
Some ( s) => {
803
803
msg. push_str ( ": " ) ;
804
- msg. push_str ( s . get ( ) ) ;
804
+ msg. push_str ( & s ) ;
805
805
}
806
806
}
807
- cx. span_lint ( UNUSED_MUST_USE , sp, & msg[ ] ) ;
807
+ cx. span_lint ( UNUSED_MUST_USE , sp, & msg) ;
808
808
return true ;
809
809
}
810
810
}
@@ -826,8 +826,8 @@ impl NonCamelCaseTypes {
826
826
fn check_case ( & self , cx : & Context , sort : & str , ident : ast:: Ident , span : Span ) {
827
827
fn is_camel_case ( ident : ast:: Ident ) -> bool {
828
828
let ident = token:: get_ident ( ident) ;
829
- if ident. get ( ) . is_empty ( ) { return true ; }
830
- let ident = ident. get ( ) . trim_matches ( '_' ) ;
829
+ if ident. is_empty ( ) { return true ; }
830
+ let ident = ident. trim_matches ( '_' ) ;
831
831
832
832
// start with a non-lowercase letter rather than non-uppercase
833
833
// ones (some scripts don't have a concept of upper/lowercase)
@@ -844,7 +844,7 @@ impl NonCamelCaseTypes {
844
844
let s = token:: get_ident ( ident) ;
845
845
846
846
if !is_camel_case ( ident) {
847
- let c = to_camel_case ( s . get ( ) ) ;
847
+ let c = to_camel_case ( & s ) ;
848
848
let m = if c. is_empty ( ) {
849
849
format ! ( "{} `{}` should have a camel case name such as `CamelCase`" , sort, s)
850
850
} else {
@@ -977,8 +977,8 @@ impl NonSnakeCase {
977
977
fn check_snake_case ( & self , cx : & Context , sort : & str , ident : ast:: Ident , span : Span ) {
978
978
fn is_snake_case ( ident : ast:: Ident ) -> bool {
979
979
let ident = token:: get_ident ( ident) ;
980
- if ident. get ( ) . is_empty ( ) { return true ; }
981
- let ident = ident. get ( ) . trim_left_matches ( '\'' ) ;
980
+ if ident. is_empty ( ) { return true ; }
981
+ let ident = ident. trim_left_matches ( '\'' ) ;
982
982
let ident = ident. trim_matches ( '_' ) ;
983
983
984
984
let mut allow_underscore = true ;
@@ -996,8 +996,8 @@ impl NonSnakeCase {
996
996
let s = token:: get_ident ( ident) ;
997
997
998
998
if !is_snake_case ( ident) {
999
- let sc = NonSnakeCase :: to_snake_case ( s . get ( ) ) ;
1000
- if sc != s . get ( ) {
999
+ let sc = NonSnakeCase :: to_snake_case ( & s ) ;
1000
+ if sc != & s [ ] {
1001
1001
cx. span_lint ( NON_SNAKE_CASE , span,
1002
1002
& * format ! ( "{} `{}` should have a snake case name such as `{}`" ,
1003
1003
sort, s, sc) ) ;
@@ -1077,10 +1077,10 @@ impl NonUpperCaseGlobals {
1077
1077
fn check_upper_case ( cx : & Context , sort : & str , ident : ast:: Ident , span : Span ) {
1078
1078
let s = token:: get_ident ( ident) ;
1079
1079
1080
- if s. get ( ) . chars ( ) . any ( |c| c. is_lowercase ( ) ) {
1081
- let uc: String = NonSnakeCase :: to_snake_case ( s . get ( ) ) . chars ( )
1080
+ if s. chars ( ) . any ( |c| c. is_lowercase ( ) ) {
1081
+ let uc: String = NonSnakeCase :: to_snake_case ( & s ) . chars ( )
1082
1082
. map ( |c| c. to_uppercase ( ) ) . collect ( ) ;
1083
- if uc != s . get ( ) {
1083
+ if uc != & s [ ] {
1084
1084
cx. span_lint ( NON_UPPER_CASE_GLOBALS , span,
1085
1085
& format ! ( "{} `{}` should have an upper case name such as `{}`" ,
1086
1086
sort, s, uc) ) ;
@@ -1241,7 +1241,7 @@ impl LintPass for UnusedImportBraces {
1241
1241
match items[ 0 ] . node {
1242
1242
ast:: PathListIdent { ref name, ..} => {
1243
1243
let m = format ! ( "braces around {} is unnecessary" ,
1244
- token:: get_ident( * name) . get ( ) ) ;
1244
+ & token:: get_ident( * name) ) ;
1245
1245
cx. span_lint ( UNUSED_IMPORT_BRACES , item. span ,
1246
1246
& m[ ] ) ;
1247
1247
} ,
@@ -1358,7 +1358,7 @@ impl UnusedMut {
1358
1358
pat_util:: pat_bindings ( & cx. tcx . def_map , & * * p, |mode, id, _, path1| {
1359
1359
let ident = path1. node ;
1360
1360
if let ast:: BindByValue ( ast:: MutMutable ) = mode {
1361
- if !token:: get_ident ( ident) . get ( ) . starts_with ( "_" ) {
1361
+ if !token:: get_ident ( ident) . starts_with ( "_" ) {
1362
1362
match mutables. entry ( ident. name . usize ( ) ) {
1363
1363
Vacant ( entry) => { entry. insert ( vec ! [ id] ) ; } ,
1364
1364
Occupied ( mut entry) => { entry. get_mut ( ) . push ( id) ; } ,
0 commit comments