fix clippy lints
This commit is contained in:
parent
7c40505d7d
commit
e19e47e6ad
6 changed files with 7 additions and 7 deletions
|
@ -25,7 +25,7 @@ pub struct Walk<'a> {
|
|||
index: usize,
|
||||
}
|
||||
|
||||
impl<'a> Walk<'a> {
|
||||
impl Walk<'_> {
|
||||
/// Walk to the first non-Nil, non-Error, non-Token node.
|
||||
pub fn node(&mut self) -> Option<NodeId> {
|
||||
while let Some(id) = self.next() {
|
||||
|
@ -57,7 +57,7 @@ impl<'a> Walk<'a> {
|
|||
}
|
||||
}
|
||||
|
||||
impl<'a> Iterator for Walk<'a> {
|
||||
impl Iterator for Walk<'_> {
|
||||
type Item = NodeId;
|
||||
|
||||
fn next(&mut self) -> Option<Self::Item> {
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
use core::{cell::Cell, error::Error, fmt};
|
||||
|
||||
use alloc::vec::Vec;
|
||||
use log::{error, info};
|
||||
use log::error;
|
||||
|
||||
use crate::{
|
||||
ast::{Ast, NodeAllocError, NodeId, NodeKind},
|
||||
|
@ -231,7 +231,7 @@ impl<'a> Parser<'a> {
|
|||
}
|
||||
}
|
||||
|
||||
impl<'a> fmt::Debug for Parser<'a> {
|
||||
impl fmt::Debug for Parser<'_> {
|
||||
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
|
||||
f.debug_struct("Parser")
|
||||
.field("events", &self.events)
|
||||
|
|
|
@ -23,6 +23,7 @@ impl fmt::Debug for Span {
|
|||
}
|
||||
|
||||
/// Source code string with a verified size limit.
|
||||
///
|
||||
/// An exact size limit is not enforced by this type - it only ensures the string isn't longer than
|
||||
/// intended, to not stall the parser for an unexpected amount of time.
|
||||
#[derive(Debug, PartialEq, Eq)]
|
||||
|
|
|
@ -110,7 +110,7 @@ pub struct TokenKindSet {
|
|||
}
|
||||
|
||||
impl TokenKindSet {
|
||||
const WORDS: usize = ((TokenKind::Error as u32 + u32::BITS - 1) / (u32::BITS)) as usize;
|
||||
const WORDS: usize = (TokenKind::Error as u32).div_ceil(u32::BITS) as usize;
|
||||
|
||||
const fn word(kind: TokenKind) -> usize {
|
||||
(kind as u32 / u32::BITS) as usize
|
||||
|
|
|
@ -5,7 +5,6 @@ use core::{
|
|||
};
|
||||
|
||||
use alloc::{string::String, vec::Vec};
|
||||
use log::debug;
|
||||
|
||||
use crate::{
|
||||
bytecode::{self, Defs, Opcode, TagId, CAPTURE_CAPTURE, CAPTURE_LOCAL},
|
||||
|
|
|
@ -16,7 +16,7 @@ impl<T> DeserializeFromStr<T> {
|
|||
}
|
||||
}
|
||||
|
||||
impl<'de, T> Visitor<'de> for DeserializeFromStr<T>
|
||||
impl<T> Visitor<'_> for DeserializeFromStr<T>
|
||||
where
|
||||
T: FromStr,
|
||||
T::Err: Display,
|
||||
|
|
Loading…
Reference in a new issue