diff --git a/rinja_parser/src/expr.rs b/rinja_parser/src/expr.rs index 086ef849..1ed2781c 100644 --- a/rinja_parser/src/expr.rs +++ b/rinja_parser/src/expr.rs @@ -3,7 +3,7 @@ use std::str; use winnow::Parser; use winnow::branch::alt; -use winnow::bytes::complete::take_till; +use winnow::bytes::take_till0; use winnow::character::complete::digit1; use winnow::combinator::{consumed, cut_err, fail, map, not, opt, peek, recognize, value}; use winnow::error::{ErrorKind, ParseError as _}; @@ -558,6 +558,6 @@ impl<'a> Suffix<'a> { } fn r#try(i: &'a str) -> ParseResult<'a, Self> { - map(preceded(take_till(not_ws), '?'), |_| Self::Try).parse_next(i) + map(preceded(take_till0(not_ws), '?'), |_| Self::Try).parse_next(i) } } diff --git a/rinja_parser/src/lib.rs b/rinja_parser/src/lib.rs index 752a0cf3..6ab0a1ca 100644 --- a/rinja_parser/src/lib.rs +++ b/rinja_parser/src/lib.rs @@ -12,8 +12,8 @@ use std::{fmt, str}; use winnow::Parser; use winnow::branch::alt; -use winnow::bytes::complete::{escaped, tag, take_till, take_while_m_n, take_while1}; -use winnow::bytes::{any, take_till1}; +use winnow::bytes::complete::{escaped, tag, take_while_m_n, take_while1}; +use winnow::bytes::{any, take_till0, take_till1}; use winnow::character::complete::{one_of, satisfy}; use winnow::combinator::{consumed, cut_err, fail, map, not, opt, recognize, value}; use winnow::error::{ErrorKind, FromExternalError}; @@ -289,7 +289,7 @@ fn not_ws(c: char) -> bool { fn ws<'a, O>( inner: impl Parser<&'a str, O, ErrorContext<'a>>, ) -> impl Parser<&'a str, O, ErrorContext<'a>> { - delimited(take_till(not_ws), inner, take_till(not_ws)) + delimited(take_till0(not_ws), inner, take_till0(not_ws)) } /// Skips input until `end` was found, but does not consume it. @@ -880,7 +880,7 @@ fn filter<'a>( i: &'a str, level: &mut Level, ) -> ParseResult<'a, (&'a str, Option>>>)> { - let (j, _) = take_till(not_ws).parse_next(i)?; + let (j, _) = take_till0(not_ws).parse_next(i)?; let had_spaces = i.len() != j.len(); let (j, _) = ('|', not('|')).parse_next(j)?; diff --git a/rinja_parser/src/node.rs b/rinja_parser/src/node.rs index 7b9e2743..4eda2f0d 100644 --- a/rinja_parser/src/node.rs +++ b/rinja_parser/src/node.rs @@ -2,8 +2,8 @@ use std::str; use winnow::Parser; use winnow::branch::alt; -use winnow::bytes::any; -use winnow::bytes::complete::{tag, take_till}; +use winnow::bytes::complete::tag; +use winnow::bytes::{any, take_till0}; use winnow::combinator::{ consumed, cut_err, eof, fail, map, map_opt, not, opt, peek, recognize, value, }; @@ -89,7 +89,7 @@ impl<'a> Node<'a> { let (j, tag) = preceded( |i| s.tag_block_start(i), peek(preceded( - (opt(Whitespace::parse), take_till(not_ws)), + (opt(Whitespace::parse), take_till0(not_ws)), identifier, )), )