Fix a new clippy lint (.nth(0)) to unbreak CI

"iter.next() is equivalent to iter.nth(0), as they both consume the
next element, but is more readable."

https://rust-lang.github.io/rust-clippy/master/index.html#iter_nth_zero
This commit is contained in:
Nickolay Ponomarev 2020-04-14 16:56:16 +03:00
parent 172ba42001
commit 4ce0eb11ae

View file

@ -40,7 +40,7 @@ fn main() {
println!("Parsing from file '{}' using {:?}", &filename, dialect);
let contents = fs::read_to_string(&filename)
.unwrap_or_else(|_| panic!("Unable to read the file {}", &filename));
let without_bom = if contents.chars().nth(0).unwrap() as u64 != 0xfeff {
let without_bom = if contents.chars().next().unwrap() as u64 != 0xfeff {
contents.as_str()
} else {
let mut chars = contents.chars();