diff --git a/vm/sre_engine/src/engine.rs b/vm/sre_engine/src/engine.rs index 34f00234e5..fb7d766e29 100644 --- a/vm/sre_engine/src/engine.rs +++ b/vm/sre_engine/src/engine.rs @@ -283,6 +283,8 @@ fn _match(req: &Request, 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(req: &Request, 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::()) { break 'result false; } @@ -523,6 +526,7 @@ fn _match(req: &Request, 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::()) { break 'result false; @@ -551,6 +555,7 @@ fn _match(req: &Request, 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::()) != $f(gctx.peek_char::()) { diff --git a/vm/sre_engine/src/string.rs b/vm/sre_engine/src/string.rs index 1340c37423..e3f14ef019 100644 --- a/vm/sre_engine/src/string.rs +++ b/vm/sre_engine/src/string.rs @@ -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); }