diff options
| author | PgBiel <9021226+PgBiel@users.noreply.github.com> | 2024-06-20 23:37:22 -0300 |
|---|---|---|
| committer | PgBiel <9021226+PgBiel@users.noreply.github.com> | 2024-06-26 12:17:53 -0300 |
| commit | b318b0ae9939ac405eebc20b6f4cc5f765bfa3c6 (patch) | |
| tree | 508b983fa4842ce621f02e2058d98b580955b3aa | |
| parent | c3c3ea9bfa7e6910136bbdcdc59f6d09860c6ab6 (diff) | |
satisfy clippy
| -rw-r--r-- | crates/typst-syntax/src/node.rs | 2 | ||||
| -rw-r--r-- | crates/typst/src/diag.rs | 2 | ||||
| -rw-r--r-- | crates/typst/src/engine.rs | 4 | ||||
| -rw-r--r-- | 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 a658617d..6a7f470b 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 b906f550..767418da 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 06d43f54..44e10243 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 f19e881b..f3d3b313 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. |
