From b318b0ae9939ac405eebc20b6f4cc5f765bfa3c6 Mon Sep 17 00:00:00 2001 From: PgBiel <9021226+PgBiel@users.noreply.github.com> Date: Thu, 20 Jun 2024 23:37:22 -0300 Subject: [PATCH] satisfy clippy --- crates/typst-syntax/src/node.rs | 2 +- crates/typst/src/diag.rs | 2 +- crates/typst/src/engine.rs | 4 ++-- crates/typst/src/eval/call.rs | 5 ++--- 4 files changed, 6 insertions(+), 7 deletions(-) diff --git a/crates/typst-syntax/src/node.rs b/crates/typst-syntax/src/node.rs index a658617d5..6a7f470bc 100644 --- a/crates/typst-syntax/src/node.rs +++ b/crates/typst-syntax/src/node.rs @@ -844,7 +844,7 @@ impl<'a> LinkedNode<'a> { // Found a parbreak or something else with two or more newlines. // Can't have an attached decorator there. - return None; + None } /// Get the next non-trivia sibling node. diff --git a/crates/typst/src/diag.rs b/crates/typst/src/diag.rs index b906f5504..767418daa 100644 --- a/crates/typst/src/diag.rs +++ b/crates/typst/src/diag.rs @@ -289,7 +289,7 @@ impl Identifier { pub fn name(&self) -> &str { match self { Self::Warn(warning_identifier) => warning_identifier.name(), - Self::User(user_identifier) => &user_identifier, + Self::User(user_identifier) => user_identifier, Self::Error(_) => unreachable!(), } } diff --git a/crates/typst/src/engine.rs b/crates/typst/src/engine.rs index 06d43f544..44e102430 100644 --- a/crates/typst/src/engine.rs +++ b/crates/typst/src/engine.rs @@ -246,9 +246,9 @@ impl Sink { return true; }; - let should_raise = !check_warning_suppressed(diag.span, world, &identifier) + let should_raise = !check_warning_suppressed(diag.span, world, identifier) && !diag.trace.iter().any(|tracepoint| { - check_warning_suppressed(tracepoint.span, world, &identifier) + check_warning_suppressed(tracepoint.span, world, identifier) }); // If this warning wasn't suppressed, any further duplicates (with diff --git a/crates/typst/src/eval/call.rs b/crates/typst/src/eval/call.rs index f19e881bd..f3d3b313d 100644 --- a/crates/typst/src/eval/call.rs +++ b/crates/typst/src/eval/call.rs @@ -168,9 +168,8 @@ impl Eval for ast::FuncCall<'_> { // Add this function call as a tracepoint to the returned // diagnostics. This allows visualizing which calls led to them, // but also allows suppressing warnings at each tracepoint. - vm.engine.tracepoint(point, span, |mut engine| { - func.call(&mut engine, vm.context, args) - }) + vm.engine + .tracepoint(point, span, |engine| func.call(engine, vm.context, args)) }; // Stacker is broken on WASM.