1
Fork 0

tidy: features.rs: Use splitn rather than a complex slice

This commit is contained in:
Josh Triplett 2018-09-01 17:43:26 -07:00
parent 0e65aeb95d
commit ebdc1bda71

View file

@ -94,7 +94,7 @@ pub fn check(path: &Path, bad: &mut bool, quiet: bool) {
let feature_name = match line.find(gate_test_str) {
Some(i) => {
&line[i+gate_test_str.len()..line[i+1..].find(' ').unwrap_or(line.len())]
line[i+gate_test_str.len()..].splitn(2, ' ').next().unwrap()
},
None => continue,
};