This commit is contained in:
Simon Gardling
2023-03-24 10:33:01 -04:00
parent 592a67a304
commit 3d1260ec5f
7 changed files with 35 additions and 52 deletions

View File

@@ -258,21 +258,19 @@ impl<'a> Hint<'a> {
#[inline]
#[allow(dead_code)]
pub const fn single(&self) -> Option<&&str> {
if let Hint::Single(data) = self {
Some(data)
} else {
None
pub const fn single(&self) -> Option<&str> {
match self {
Hint::Single(data) => Some(data),
_ => None,
}
}
#[inline]
#[allow(dead_code)]
pub const fn many(&self) -> Option<&&[&str]> {
if let Hint::Many(data) = self {
Some(data)
} else {
None
pub const fn many(&self) -> Option<&[&str]> {
match self {
Hint::Many(data) => Some(data),
_ => None,
}
}
}