Skip to content

Commit eb447f4

Browse files
committedMar 27, 2017
Fix various useless derefs and slicings
1 parent 79feb94 commit eb447f4

File tree

46 files changed

+120
-122
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

46 files changed

+120
-122
lines changed
 

‎src/bootstrap/check.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -586,7 +586,7 @@ fn android_copy_libs(build: &Build, compiler: &Compiler, target: &str) {
586586
.arg(ADB_TEST_DIR));
587587

588588
let target_dir = format!("{}/{}", ADB_TEST_DIR, target);
589-
build.run(Command::new("adb").args(&["shell", "mkdir", &target_dir[..]]));
589+
build.run(Command::new("adb").args(&["shell", "mkdir", &target_dir]));
590590

591591
for f in t!(build.sysroot_libdir(compiler, target).read_dir()) {
592592
let f = t!(f);

‎src/grammar/verify.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -196,7 +196,7 @@ fn parse_antlr_token(s: &str, tokens: &HashMap<String, token::Token>, surrogate_
196196
let toknum = &s[content_end + 3 .. toknum_end];
197197

198198
let not_found = format!("didn't find token {:?} in the map", toknum);
199-
let proto_tok = tokens.get(toknum).expect(&not_found[..]);
199+
let proto_tok = tokens.get(toknum).expect(&not_found);
200200

201201
let nm = Symbol::intern(content);
202202

@@ -304,14 +304,14 @@ fn main() {
304304
let mut token_file = File::open(&Path::new(&args.next().unwrap())).unwrap();
305305
let mut token_list = String::new();
306306
token_file.read_to_string(&mut token_list).unwrap();
307-
let token_map = parse_token_list(&token_list[..]);
307+
let token_map = parse_token_list(&token_list);
308308

309309
let stdin = std::io::stdin();
310310
let lock = stdin.lock();
311311
let lines = lock.lines();
312312
let antlr_tokens = lines.map(|l| parse_antlr_token(l.unwrap().trim(),
313313
&token_map,
314-
&surrogate_pairs_pos[..],
314+
&surrogate_pairs_pos,
315315
has_bom));
316316

317317
for antlr_tok in antlr_tokens {

0 commit comments

Comments
 (0)