summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPgBiel <9021226+PgBiel@users.noreply.github.com>2024-07-16 17:03:47 -0300
committerPgBiel <9021226+PgBiel@users.noreply.github.com>2024-07-16 20:00:51 -0300
commit457892cd7fc77f055a41b7bfefbcba74d9b3948d (patch)
tree82670c6c9bc29e88b8bd12d51c01b4e27f099dd6
parenta5d36d6931d1c1032656d85309304385c6966254 (diff)
improve some var names
-rw-r--r--crates/typst-syntax/src/lexer.rs4
-rw-r--r--crates/typst/src/diag.rs4
2 files changed, 4 insertions, 4 deletions
diff --git a/crates/typst-syntax/src/lexer.rs b/crates/typst-syntax/src/lexer.rs
index 3c4e81f9..0c21fb23 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 ef488e99..03f8ef88 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::<ast::Annotation>().unwrap();
- if check_annotation_suppresses_warning(annotation, identifier) {
+ if check_annotation_suppresses_warning(annotation, warning) {
return true;
}
searched_annotation = sibling.prev_attached_annotation();