Clippy lints
This commit is contained in:
parent
3f86c08dc1
commit
f0e1d2b045
@ -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> {
|
pub fn one_of<'a>(items: &'static str) -> impl Parser<&'a str, &'a str, &'a str> {
|
||||||
move |input: &'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) {
|
if items.contains(ch) {
|
||||||
let (first, rest) = input.split_at(1);
|
let (first, rest) = input.split_at(1);
|
||||||
return Ok((first, rest));
|
return Ok((first, rest));
|
||||||
@ -60,7 +60,7 @@ pub fn identifier(input: &str) -> ParseResult<&str, String, &str> {
|
|||||||
_ => return Err(input),
|
_ => return Err(input),
|
||||||
}
|
}
|
||||||
|
|
||||||
while let Some(next) = chars.next() {
|
for next in chars {
|
||||||
if next.is_alphanumeric() {
|
if next.is_alphanumeric() {
|
||||||
buf.push(next);
|
buf.push(next);
|
||||||
} else {
|
} else {
|
||||||
|
Loading…
Reference in New Issue
Block a user