style: run cargo clippy

This commit is contained in:
PoiScript 2023-11-15 13:03:43 +08:00
parent db7fb70724
commit ed987d468a
No known key found for this signature in database
GPG key ID: 22C2B1249D99985E
4 changed files with 10 additions and 9 deletions

View file

@ -46,9 +46,7 @@ impl OrgTable {
.filter_map(OrgTableRow::cast)
.skip_while(|row| row.is_rule())
.skip_while(|row| row.is_standard())
.skip_while(|row| row.is_rule())
.next()
.is_some()
.any(|row| !row.is_rule())
}
}

View file

@ -145,9 +145,8 @@ pub trait Traverser {
/// Called when visiting any token
fn token(&mut self, token: SyntaxToken, ctx: &mut TraversalContext) {
match token.kind() {
TEXT => self.text(token, ctx),
_ => {}
if token.kind() == TEXT {
self.text(token, ctx);
}
take_control!(ctx);
}

View file

@ -120,9 +120,11 @@ fn headline_stars(input: Input) -> IResult<Input, Input, ()> {
if level == 0 {
Err(nom::Err::Error(()))
} else if input.input_len() == level {
Ok(input.take_split(level))
} else if bytes[level] == b'\n' || bytes[level] == b'\r' || bytes[level] == b' ' {
} else if input.input_len() == level
|| bytes[level] == b'\n'
|| bytes[level] == b'\r'
|| bytes[level] == b' '
{
Ok(input.take_split(level))
} else {
Err(nom::Err::Error(()))

View file

@ -1,3 +1,5 @@
#![allow(clippy::type_complexity)]
use nom::{
branch::alt,
bytes::complete::{tag, take_till, take_while1},