From 821a79c12e94338ebad236be97429f89e143e7ae Mon Sep 17 00:00:00 2001 From: Joe Grund Date: Wed, 8 May 2024 16:22:46 -0400 Subject: [PATCH] Take until newline Signed-off-by: Joe Grund --- src/quota/quota_parser.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/quota/quota_parser.rs b/src/quota/quota_parser.rs index e399bb6..e7b1a25 100644 --- a/src/quota/quota_parser.rs +++ b/src/quota/quota_parser.rs @@ -11,7 +11,7 @@ use crate::{ use combine::{ attempt, choice, eof, error::{ParseError, StreamError}, - many, one_of, optional, + optional, parser::{ char::{alpha_num, newline, string}, repeat::take_until, @@ -67,7 +67,7 @@ where { ( optional(newline()), // If quota stats are present, the whole yaml blob will start on a newline - many::, _, _>(alpha_num().or(one_of("_-:".chars()))), // But yaml header might not be indented, ignore it + take_until::, _, _>(newline()), // But yaml header might not be indented, ignore it newline(), take_until(attempt((newline(), alpha_num()).map(drop).or(eof()))), ) @@ -85,7 +85,7 @@ where { ( optional(newline()), // If quota stats are present, the whole yaml blob will start on a newline - many::, _, _>(alpha_num().or(one_of("_-:".chars()))), // But yaml header might not be indented, ignore it + take_until::, _, _>(newline()), // But yaml header might not be indented, ignore it newline(), take_until(attempt((newline(), alpha_num()).map(drop).or(eof()))), )