From 1a233788273f3ee26bc48d36e7d2d12803218e25 Mon Sep 17 00:00:00 2001 From: Ed Page Date: Sun, 7 Jan 2024 23:51:36 -0600 Subject: [PATCH] [nextest-filering] Remove reliance on Incomplete (#1159) Incomplete specifically means that there isn't enough data to continue processing. Its a bit of a hack to reuse this for error recovery. This will no longer work if/when moving to `winnow`. At least judging by the tests, nothing fails when removing this so its good enough? --- nextest-filtering/src/parsing.rs | 6 ------ nextest-filtering/src/parsing/unicode_string.rs | 6 ++---- 2 files changed, 2 insertions(+), 10 deletions(-) diff --git a/nextest-filtering/src/parsing.rs b/nextest-filtering/src/parsing.rs index c6cd985b7d2..f6613f7f22d 100644 --- a/nextest-filtering/src/parsing.rs +++ b/nextest-filtering/src/parsing.rs @@ -22,7 +22,6 @@ use nom::{ combinator::{eof, map, peek, recognize, value, verify}, multi::{fold_many0, many0}, sequence::{delimited, pair, preceded, terminated}, - Slice, }; use nom_tracable::tracable_parser; use std::{cell::RefCell, fmt}; @@ -333,11 +332,6 @@ fn parse_matcher_text(input: Span<'_>) -> IResult<'_, Option> { )(input.clone()) { Ok((i, res)) => (i, res.flatten()), - Err(nom::Err::Incomplete(_)) => { - let i = input.slice(input.fragment().len()..); - // No need for error reporting, missing closing ')' will be detected after - (i, None) - } Err(_) => unreachable!(), }; diff --git a/nextest-filtering/src/parsing/unicode_string.rs b/nextest-filtering/src/parsing/unicode_string.rs index b9a6465bc32..8af833c42d1 100644 --- a/nextest-filtering/src/parsing/unicode_string.rs +++ b/nextest-filtering/src/parsing/unicode_string.rs @@ -7,8 +7,8 @@ use super::{expect_n, IResult, Span, SpanLength}; use crate::errors::ParseSingleError; use nom::{ branch::alt, - bytes::streaming::{is_not, take_while_m_n}, - character::streaming::char, + bytes::complete::{is_not, take_while_m_n}, + character::complete::char, combinator::{map, map_opt, map_res, value, verify}, multi::fold_many0, sequence::{delimited, preceded}, @@ -128,8 +128,6 @@ fn parse_fragment(input: Span<'_>) -> IResult<'_, Option>> { /// Construct a string by consuming the input until the next unescaped ) or ,. /// /// Returns None if the string isn't valid. -/// -/// Returns Err(Incomplete(1)) if an ending delimiter ) or , is not found. #[tracable_parser] pub(super) fn parse_string(input: Span<'_>) -> IResult<'_, Option> { fold_many0(