minor: Simplify conversion for ASCII flags in compound rules

This commit is contained in:
Michael Davis
2025-03-04 09:48:57 -05:00
parent 247bc4d1b0
commit 0335a521d4

View File

@@ -1416,7 +1416,8 @@ pub(crate) fn parse_compound_rule(
loop {
let flag = match chars.next() {
Some(ch) if !ch.is_ascii() => return Err(ParseFlagError::NonAscii(ch).into()),
Some(ch) if ch != '?' && ch != '*' => try_flag_from_char(ch)?,
// All ASCII can fit into a u16 (and a u8).
Some(ch) if ch != '?' && ch != '*' => try_flag_from_u16(ch as u16)?,
None => break,
_ => return Err(ParseCompoundRuleError::InvalidFormat),
};