ListKind: Use an exhaustive match to future-proof.

This commit is contained in:
Nick Mathewson 2022-03-29 08:23:47 -04:00
parent c721c8ee53
commit 578f2925d9
1 changed files with 4 additions and 1 deletions

View File

@ -112,7 +112,10 @@ impl ListKind {
/// Return true if this source indicates a guard that came from a sample /// Return true if this source indicates a guard that came from a sample
/// taken from a network directory at some point. /// taken from a network directory at some point.
pub(crate) fn is_guard_sample(&self) -> bool { pub(crate) fn is_guard_sample(&self) -> bool {
self != &ListKind::Fallback match self {
ListKind::Primary | ListKind::Confirmed | ListKind::Sample => true,
ListKind::Fallback => false,
}
} }
} }