improve boundary management
This commit is contained in:
parent
6c74860f82
commit
28873ce073
1 changed files with 2 additions and 2 deletions
|
@ -1,4 +1,4 @@
|
|||
use nom::{bytes::complete::tag, combinator::opt, sequence::tuple, IResult};
|
||||
use nom::{branch::alt, bytes::complete::tag, combinator::{eof, opt}, sequence::tuple, IResult};
|
||||
|
||||
use crate::text::whitespace::obs_crlf;
|
||||
|
||||
|
@ -15,7 +15,7 @@ pub fn boundary<'a>(boundary: &[u8]) -> impl Fn(&'a [u8]) -> IResult<&'a [u8], D
|
|||
tag(b"--"),
|
||||
tag(boundary),
|
||||
opt(tag(b"--")),
|
||||
opt(obs_crlf),
|
||||
alt((obs_crlf, eof)),
|
||||
))(input)?;
|
||||
match last {
|
||||
Some(_) => Ok((rest, Delimiter::Last)),
|
||||
|
|
Loading…
Reference in a new issue