Ensure OptIdentifier::Multi(names) can never be empty

This commit is contained in:
2025-11-01 22:25:05 +11:00
parent b846d9be6e
commit e496a8063d
2 changed files with 15 additions and 6 deletions

View File

@@ -74,7 +74,7 @@ impl Opts<&'static str> {
pub fn parse_map<'a, S: AsRef<str> + 'a, I: Iterator<Item = S>>(&self, program_name: &str, args: I,
error: impl FnOnce(&str, ParseError)) -> ParseMapResult {
let mut out: BTreeMap<&'static str, String> = BTreeMap::new();
match self.parse(&program_name, args, |program_name, id, _opt, _name, arg| {
match self.parse(&program_name, args, |_program_name, id, _opt, _name, arg| {
out.insert(id, arg.into());
Ok(ParseControl::Continue)
}, error) {