From f0e1d2b045b08d6c97886a2c14cb348e9ef9105f Mon Sep 17 00:00:00 2001 From: Greg Shuflin Date: Sun, 23 Oct 2022 00:35:24 -0700 Subject: [PATCH] Clippy lints --- src/primitives/mod.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/primitives/mod.rs b/src/primitives/mod.rs index c280b41..13bd273 100644 --- a/src/primitives/mod.rs +++ b/src/primitives/mod.rs @@ -23,7 +23,7 @@ pub fn any_char(input: &str) -> ParseResult<&str, char, &str> { pub fn one_of<'a>(items: &'static str) -> impl Parser<&'a str, &'a str, &'a str> { move |input: &'a str| { - if let Some(ch) = input.chars().nth(0) { + if let Some(ch) = input.chars().next() { if items.contains(ch) { let (first, rest) = input.split_at(1); return Ok((first, rest)); @@ -60,7 +60,7 @@ pub fn identifier(input: &str) -> ParseResult<&str, String, &str> { _ => return Err(input), } - while let Some(next) = chars.next() { + for next in chars { if next.is_alphanumeric() { buf.push(next); } else {