Skip to content

Commit 4ce0eb1

Browse files
committed
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
1 parent 172ba42 commit 4ce0eb1

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

examples/cli.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ fn main() {
4040
println!("Parsing from file '{}' using {:?}", &filename, dialect);
4141
let contents = fs::read_to_string(&filename)
4242
.unwrap_or_else(|_| panic!("Unable to read the file {}", &filename));
43-
let without_bom = if contents.chars().nth(0).unwrap() as u64 != 0xfeff {
43+
let without_bom = if contents.chars().next().unwrap() as u64 != 0xfeff {
4444
contents.as_str()
4545
} else {
4646
let mut chars = contents.chars();

0 commit comments

Comments
 (0)