suppress clippy warnings

This commit is contained in:
Jeong YunWon
2024-03-22 11:28:49 +09:00
parent 12601d0b44
commit 1dd9a2fbe4
2 changed files with 6 additions and 1 deletions

View File

@@ -283,6 +283,8 @@ fn _match<S: StrDrive>(req: &Request<S>, state: &mut State, mut ctx: MatchContex
let mut context_stack = vec![];
let mut popped_result = false;
// NOTE: 'result loop is not an actual loop but break label
#[allow(clippy::never_loop)]
'coro: loop {
popped_result = 'result: loop {
let yielded = 'context: loop {
@@ -513,6 +515,7 @@ fn _match<S: StrDrive>(req: &Request<S>, state: &mut State, mut ctx: MatchContex
loop {
macro_rules! general_op_literal {
($f:expr) => {{
#[allow(clippy::redundant_closure_call)]
if ctx.at_end(req) || !$f(ctx.peek_code(req, 1), ctx.peek_char::<S>()) {
break 'result false;
}
@@ -523,6 +526,7 @@ fn _match<S: StrDrive>(req: &Request<S>, state: &mut State, mut ctx: MatchContex
macro_rules! general_op_in {
($f:expr) => {{
#[allow(clippy::redundant_closure_call)]
if ctx.at_end(req) || !$f(&ctx.pattern(req)[2..], ctx.peek_char::<S>())
{
break 'result false;
@@ -551,6 +555,7 @@ fn _match<S: StrDrive>(req: &Request<S>, state: &mut State, mut ctx: MatchContex
};
for _ in group_start..group_end {
#[allow(clippy::redundant_closure_call)]
if ctx.at_end(req)
|| $f(ctx.peek_char::<S>()) != $f(gctx.peek_char::<S>())
{

View File

@@ -101,7 +101,7 @@ impl StrDrive for &str {
#[inline]
fn adjust_cursor(&self, cursor: &mut StringCursor, n: usize) {
if cursor.ptr.is_null() || cursor.position > n {
*cursor = Self::create_cursor(&self, n);
*cursor = Self::create_cursor(self, n);
} else if cursor.position < n {
Self::skip(cursor, n - cursor.position);
}