diff options
| author | John Turner <jturner.usa@gmail.com> | 2025-11-01 17:28:19 +0000 |
|---|---|---|
| committer | John Turner <jturner.usa@gmail.com> | 2025-11-01 17:28:19 +0000 |
| commit | a38b01cd0494570cb067acd06fdadce9a6ef0ef0 (patch) | |
| tree | 239726881c83797fff92c5954546d873e4e91e2c /src/ebuild/repo/mod.rs | |
| parent | 6b04125d14503790e6ab388e11f1f9ebe7e7faea (diff) | |
| download | gentoo-utils-a38b01cd0494570cb067acd06fdadce9a6ef0ef0.tar.gz | |
update parsers to use the ParserIter trait from mon
Diffstat (limited to 'src/ebuild/repo/mod.rs')
| -rw-r--r-- | src/ebuild/repo/mod.rs | 17 |
1 files changed, 11 insertions, 6 deletions
diff --git a/src/ebuild/repo/mod.rs b/src/ebuild/repo/mod.rs index 46d43ac..53ad6f7 100644 --- a/src/ebuild/repo/mod.rs +++ b/src/ebuild/repo/mod.rs @@ -5,7 +5,7 @@ use std::{ use get::Get; -use mon::{Parser, input::InputIter, tag, whitespace1}; +use mon::{Parser, ParserIter, input::InputIter, tag, whitespace1}; use crate::{ Parseable, @@ -200,7 +200,8 @@ fn read_src_uri(input: &str) -> Option<Result<Vec<Depend<SrcUri>>, Error>> { .find_map(|line| line.strip_prefix("SRC_URI="))?; match Depend::<SrcUri>::parser() - .separated_by(whitespace1(), 0..) + .separated_by(whitespace1()) + .many() .parse_finished(InputIter::new(line)) { Ok(slot) => Some(Ok(slot)), @@ -223,7 +224,8 @@ fn read_inherit(input: &str) -> Option<Result<Vec<Eclass>, Error>> { .find_map(|line| line.strip_prefix("INHERIT="))?; match Eclass::parser() - .separated_by(whitespace1(), 0..) + .separated_by(whitespace1()) + .many() .parse_finished(InputIter::new(line)) { Ok(inherit) => Some(Ok(inherit)), @@ -235,7 +237,8 @@ fn read_iuse(input: &str) -> Option<Result<Vec<IUseFlag>, Error>> { let line = input.lines().find_map(|line| line.strip_prefix("IUSE="))?; match IUseFlag::parser() - .separated_by(whitespace1(), 0..) + .separated_by(whitespace1()) + .many() .parse_finished(InputIter::new(line)) { Ok(iuse) => Some(Ok(iuse)), @@ -249,7 +252,8 @@ fn read_license(input: &str) -> Option<Result<Vec<Depend<License>>, Error>> { .find_map(|line| line.strip_suffix("LICENSE="))?; match Depend::<License>::parser() - .separated_by(whitespace1(), 0..) + .separated_by(whitespace1()) + .many() .parse_finished(InputIter::new(line)) { Ok(license) => Some(Ok(license)), @@ -297,7 +301,8 @@ fn read_idepend(input: &str) -> Option<Result<Vec<Depend<Atom>>, Error>> { fn parse_depends(line: &str) -> Result<Vec<Depend<Atom>>, Error> { Depend::<Atom>::parser() - .separated_by(whitespace1(), 0..) + .separated_by(whitespace1()) + .many() .parse_finished(InputIter::new(line)) .map_err(|_| Error::Parser(line.to_string())) } |
