mirror of
https://github.com/ProvableHQ/leo.git
synced 2024-12-25 11:12:48 +03:00
clippy
This commit is contained in:
parent
daba572d94
commit
bbc6121f9d
@ -25,7 +25,7 @@ use std::fmt;
|
||||
/// Returns a reference to bytes from the given input if the given string is equal to the bytes,
|
||||
/// otherwise returns [`None`].
|
||||
///
|
||||
fn eat<'a>(input: &'a [u8], wanted: &str) -> Option<usize> {
|
||||
fn eat(input: &[u8], wanted: &str) -> Option<usize> {
|
||||
let wanted = wanted.as_bytes();
|
||||
if input.len() < wanted.len() {
|
||||
return None;
|
||||
|
@ -91,7 +91,7 @@ pub(crate) fn tokenize(path: &str, input: StrTendril) -> Result<Vec<SpannedToken
|
||||
path,
|
||||
content: input.subtendril(
|
||||
line_start as u32,
|
||||
input[line_start..].find('\n').unwrap_or(input.len()) as u32,
|
||||
input[line_start..].find('\n').unwrap_or_else(|| input.len()) as u32,
|
||||
),
|
||||
},
|
||||
));
|
||||
|
Loading…
Reference in New Issue
Block a user