This commit is contained in:
Simon Gardling
2022-03-31 14:43:35 -04:00
parent 92e8da6198
commit dc53889dd5
4 changed files with 15 additions and 30 deletions

View File

@@ -64,12 +64,7 @@ impl HintEnum<'static> {
}
}
pub fn is_multi(&self) -> bool {
match self {
HintEnum::Many(_) => true,
_ => false,
}
}
pub fn is_multi(&self) -> bool { matches!(self, HintEnum::Many(_)) }
pub fn ensure_many(&self) -> &[&str] {
match self {
@@ -77,12 +72,7 @@ impl HintEnum<'static> {
_ => panic!("ensure_many called on non-Many value"),
}
}
pub fn is_some(&self) -> bool {
match self {
HintEnum::None => false,
_ => true,
}
}
pub fn is_some(&self) -> bool { !matches!(self, HintEnum::None) }
pub fn is_none(&self) -> bool { !self.is_some() }