From 5cc7c9e062b6abc83c8c4804de4e87a5110d0a07 Mon Sep 17 00:00:00 2001 From: Sergei Zharinov Date: Mon, 29 Dec 2025 23:31:40 -0300 Subject: [PATCH] refactor(alt_kinds): inline branch_range helper --- crates/plotnik-lib/src/query/alt_kinds.rs | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) diff --git a/crates/plotnik-lib/src/query/alt_kinds.rs b/crates/plotnik-lib/src/query/alt_kinds.rs index 9c6074a6..e9645af8 100644 --- a/crates/plotnik-lib/src/query/alt_kinds.rs +++ b/crates/plotnik-lib/src/query/alt_kinds.rs @@ -3,8 +3,6 @@ //! Checks constraints that are easier to express after parsing: //! - Mixed tagged/untagged alternations -use rowan::TextRange; - use super::invariants::ensure_both_branch_kinds; use super::visitor::{Visitor, walk, walk_alt_expr}; use crate::SourceId; @@ -58,19 +56,13 @@ impl AltKindsValidator<'_> { .expect("tagged branch found via filter must have label") .text_range(); - let untagged_range = branch_range(untagged_branch); - self.diag .report( self.source_id, DiagnosticKind::MixedAltBranches, - untagged_range, + untagged_branch.text_range(), ) .related_to(self.source_id, tagged_range, "tagged branch here") .emit(); } } - -fn branch_range(branch: &Branch) -> TextRange { - branch.text_range() -}