From fee985fbbcd25d8614071f376e12dcc629c4691a Mon Sep 17 00:00:00 2001 From: YOSHIOKA Takuma Date: Fri, 21 Feb 2025 21:16:24 +0900 Subject: [PATCH] Set error span correctly `KdlParseError` has `span` field unconditionally. --- src/v2_parser.rs | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/src/v2_parser.rs b/src/v2_parser.rs index 9ac1d32..9d6080b 100644 --- a/src/v2_parser.rs +++ b/src/v2_parser.rs @@ -759,12 +759,8 @@ fn node_children(input: &mut Input<'_>) -> PResult { .map(|_| KdlDocument::new()) .or_else(|mut e: ErrMode| { e = match e { - #[cfg_attr(not(feature = "span"), allow(unused_mut))] ErrMode::Cut(mut pe) => { - #[cfg(feature = "span")] - { - pe.span = Some((_before_open_loc.._after_open_loc).into()); - } + pe.span = Some((_before_open_loc.._after_open_loc).into()); ErrMode::Cut(pe) } e => return Err(e),