@@ -801,10 +801,10 @@ impl LintPass for UnusedResults {
801801 None => { }
802802 Some ( s) => {
803803 msg. push_str ( ": " ) ;
804- msg. push_str ( & s[ ] ) ;
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 }
@@ -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[ ] ) ;
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 {
@@ -996,7 +996,7 @@ impl NonSnakeCase {
996996 let s = token:: get_ident ( ident) ;
997997
998998 if !is_snake_case ( ident) {
999- let sc = NonSnakeCase :: to_snake_case ( & s[ ] ) ;
999+ let sc = NonSnakeCase :: to_snake_case ( & s) ;
10001000 if sc != & s[ ] {
10011001 cx. span_lint ( NON_SNAKE_CASE , span,
10021002 & * format ! ( "{} `{}` should have a snake case name such as `{}`" ,
@@ -1078,7 +1078,7 @@ impl NonUpperCaseGlobals {
10781078 let s = token:: get_ident ( ident) ;
10791079
10801080 if s. chars ( ) . any ( |c| c. is_lowercase ( ) ) {
1081- let uc: String = NonSnakeCase :: to_snake_case ( & s[ ] ) . chars ( )
1081+ let uc: String = NonSnakeCase :: to_snake_case ( & s) . chars ( )
10821082 . map ( |c| c. to_uppercase ( ) ) . collect ( ) ;
10831083 if uc != & s[ ] {
10841084 cx. span_lint ( NON_UPPER_CASE_GLOBALS , span,
@@ -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) [ ] ) ;
1244+ & token:: get_ident( * name) ) ;
12451245 cx. span_lint ( UNUSED_IMPORT_BRACES , item. span ,
12461246 & m[ ] ) ;
12471247 } ,
0 commit comments