From 457892cd7fc77f055a41b7bfefbcba74d9b3948d Mon Sep 17 00:00:00 2001 From: PgBiel <9021226+PgBiel@users.noreply.github.com> Date: Tue, 16 Jul 2024 17:03:47 -0300 Subject: [PATCH] improve some var names --- crates/typst-syntax/src/lexer.rs | 4 ++-- crates/typst/src/diag.rs | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/crates/typst-syntax/src/lexer.rs b/crates/typst-syntax/src/lexer.rs index 3c4e81f93..0c21fb236 100644 --- a/crates/typst-syntax/src/lexer.rs +++ b/crates/typst-syntax/src/lexer.rs @@ -255,8 +255,8 @@ impl Lexer<'_> { return SyntaxNode::inner(SyntaxKind::Annotation, subtree); } - let annotation_name = self.annotation_name(current_start); - subtree.push(self.emit_token(annotation_name, current_start)); + let name = self.annotation_name(current_start); + subtree.push(self.emit_token(name, current_start)); // Left parenthesis before annotation arguments. let current_start = self.s.cursor(); diff --git a/crates/typst/src/diag.rs b/crates/typst/src/diag.rs index ef488e999..03f8ef886 100644 --- a/crates/typst/src/diag.rs +++ b/crates/typst/src/diag.rs @@ -544,7 +544,7 @@ pub fn deduplicate_and_suppress_warnings( /// in. If one of the ancestors of the node where the warning occurred has a /// warning suppression annotation sibling right before it suppressing this /// particular warning, the warning is considered suppressed. -fn is_warning_suppressed(span: Span, world: &dyn World, identifier: &Identifier) -> bool { +fn is_warning_suppressed(span: Span, world: &dyn World, warning: &Identifier) -> bool { // Don't suppress detached warnings. let Some(source) = span.id().and_then(|file| world.source(file).ok()) else { return false; @@ -559,7 +559,7 @@ fn is_warning_suppressed(span: Span, world: &dyn World, identifier: &Identifier) let mut searched_annotation = node.prev_attached_annotation(); while let Some(sibling) = searched_annotation { let annotation = sibling.cast::().unwrap(); - if check_annotation_suppresses_warning(annotation, identifier) { + if check_annotation_suppresses_warning(annotation, warning) { return true; } searched_annotation = sibling.prev_attached_annotation();