From 19e8bb8b29ea1d936d798ab5b5b178b14252f454 Mon Sep 17 00:00:00 2001 From: George Date: Sun, 21 Apr 2024 13:05:02 -0400 Subject: [PATCH] stipulate `sep` parser must consume (#1723) the separator parser cannot be any parser but must be a consuming parser, contrary to documentation. Ideally, we should have a trait to assert this constraint as well. --- src/multi/mod.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/multi/mod.rs b/src/multi/mod.rs index 2218106b3..ba67bc180 100644 --- a/src/multi/mod.rs +++ b/src/multi/mod.rs @@ -337,7 +337,7 @@ where /// [`cut`][crate::combinator::cut]. /// /// # Arguments -/// * `sep` Parses the separator between list elements. +/// * `sep` Parses the separator between list elements. Must be consuming. /// * `f` Parses the elements of the list. /// /// ```rust @@ -458,7 +458,7 @@ where /// [`cut`][crate::combinator::cut]. /// /// # Arguments -/// * `sep` Parses the separator between list elements. +/// * `sep` Parses the separator between list elements. Must be consuming. /// * `f` Parses the elements of the list. /// ```rust /// # use nom::{Err, error::{Error, ErrorKind}, Needed, IResult, Parser};