From 37a176a36678a1ae65a4b15b167880ab00b0298a Mon Sep 17 00:00:00 2001 From: noriaki watanabe Date: Thu, 25 Dec 2025 21:28:55 +0900 Subject: [PATCH] Return results from parse_b / parse_signless_b directly in parse_nth --- src/nth.rs | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/nth.rs b/src/nth.rs index 4fe5a6bc..76c13f35 100644 --- a/src/nth.rs +++ b/src/nth.rs @@ -20,8 +20,8 @@ pub fn parse_nth<'i>(input: &mut Parser<'i, '_>) -> Result<(i32, i32), BasicPars } => { match_ignore_ascii_case! { unit, - "n" => Ok(parse_b(input, a)?), - "n-" => Ok(parse_signless_b(input, a, -1)?), + "n" => parse_b(input, a), + "n-" => parse_signless_b(input, a, -1), _ => match parse_n_dash_digits(unit) { Ok(b) => Ok((a, b)), Err(()) => { @@ -35,10 +35,10 @@ pub fn parse_nth<'i>(input: &mut Parser<'i, '_>) -> Result<(i32, i32), BasicPars match_ignore_ascii_case! { value, "even" => Ok((2, 0)), "odd" => Ok((2, 1)), - "n" => Ok(parse_b(input, 1)?), - "-n" => Ok(parse_b(input, -1)?), - "n-" => Ok(parse_signless_b(input, 1, -1)?), - "-n-" => Ok(parse_signless_b(input, -1, -1)?), + "n" => parse_b(input, 1), + "-n" => parse_b(input, -1), + "n-" => parse_signless_b(input, 1, -1), + "-n-" => parse_signless_b(input, -1, -1), _ => { let (slice, a) = if let Some(stripped) = value.strip_prefix('-') { (stripped, -1)