@@ -699,7 +699,7 @@ impl LintPass for UnusedAttributes {
699699
700700 if !attr:: is_used ( attr) {
701701 cx. span_lint ( UNUSED_ATTRIBUTES , attr. span , "unused attribute" ) ;
702- if CRATE_ATTRS . contains ( & attr. name ( ) . get ( ) ) {
702+ if CRATE_ATTRS . contains ( & & attr. name ( ) [ ] ) {
703703 let msg = match attr. node . style {
704704 ast:: AttrOuter => "crate-level attribute should be an inner \
705705 attribute: add an exclamation mark: #![foo]",
@@ -801,10 +801,10 @@ impl LintPass for UnusedResults {
801801 None => { }
802802 Some ( s) => {
803803 msg. push_str ( ": " ) ;
804- msg. push_str ( s . get ( ) ) ;
804+ msg. push_str ( & s ) ;
805805 }
806806 }
807- cx. span_lint ( UNUSED_MUST_USE , sp, & msg[ ] ) ;
807+ cx. span_lint ( UNUSED_MUST_USE , sp, & msg) ;
808808 return true ;
809809 }
810810 }
@@ -826,8 +826,8 @@ impl NonCamelCaseTypes {
826826 fn check_case ( & self , cx : & Context , sort : & str , ident : ast:: Ident , span : Span ) {
827827 fn is_camel_case ( ident : ast:: Ident ) -> bool {
828828 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 ( '_' ) ;
831831
832832 // start with a non-lowercase letter rather than non-uppercase
833833 // ones (some scripts don't have a concept of upper/lowercase)
@@ -844,7 +844,7 @@ impl NonCamelCaseTypes {
844844 let s = token:: get_ident ( ident) ;
845845
846846 if !is_camel_case ( ident) {
847- let c = to_camel_case ( s . get ( ) ) ;
847+ let c = to_camel_case ( & s ) ;
848848 let m = if c. is_empty ( ) {
849849 format ! ( "{} `{}` should have a camel case name such as `CamelCase`" , sort, s)
850850 } else {
@@ -977,8 +977,8 @@ impl NonSnakeCase {
977977 fn check_snake_case ( & self , cx : & Context , sort : & str , ident : ast:: Ident , span : Span ) {
978978 fn is_snake_case ( ident : ast:: Ident ) -> bool {
979979 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 ( '\'' ) ;
982982 let ident = ident. trim_matches ( '_' ) ;
983983
984984 let mut allow_underscore = true ;
@@ -996,8 +996,8 @@ impl NonSnakeCase {
996996 let s = token:: get_ident ( ident) ;
997997
998998 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 [ ] {
10011001 cx. span_lint ( NON_SNAKE_CASE , span,
10021002 & * format ! ( "{} `{}` should have a snake case name such as `{}`" ,
10031003 sort, s, sc) ) ;
@@ -1077,10 +1077,10 @@ impl NonUpperCaseGlobals {
10771077 fn check_upper_case ( cx : & Context , sort : & str , ident : ast:: Ident , span : Span ) {
10781078 let s = token:: get_ident ( ident) ;
10791079
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 ( )
10821082 . map ( |c| c. to_uppercase ( ) ) . collect ( ) ;
1083- if uc != s . get ( ) {
1083+ if uc != & s [ ] {
10841084 cx. span_lint ( NON_UPPER_CASE_GLOBALS , span,
10851085 & format ! ( "{} `{}` should have an upper case name such as `{}`" ,
10861086 sort, s, uc) ) ;
@@ -1241,7 +1241,7 @@ impl LintPass for UnusedImportBraces {
12411241 match items[ 0 ] . node {
12421242 ast:: PathListIdent { ref name, ..} => {
12431243 let m = format ! ( "braces around {} is unnecessary" ,
1244- token:: get_ident( * name) . get ( ) ) ;
1244+ & token:: get_ident( * name) ) ;
12451245 cx. span_lint ( UNUSED_IMPORT_BRACES , item. span ,
12461246 & m[ ] ) ;
12471247 } ,
@@ -1358,7 +1358,7 @@ impl UnusedMut {
13581358 pat_util:: pat_bindings ( & cx. tcx . def_map , & * * p, |mode, id, _, path1| {
13591359 let ident = path1. node ;
13601360 if let ast:: BindByValue ( ast:: MutMutable ) = mode {
1361- if !token:: get_ident ( ident) . get ( ) . starts_with ( "_" ) {
1361+ if !token:: get_ident ( ident) . starts_with ( "_" ) {
13621362 match mutables. entry ( ident. name . usize ( ) ) {
13631363 Vacant ( entry) => { entry. insert ( vec ! [ id] ) ; } ,
13641364 Occupied ( mut entry) => { entry. get_mut ( ) . push ( id) ; } ,
0 commit comments