Merge pull request #238 from jacwah/refactor

`Ignore` refactorings
This commit is contained in:
Andrew Gallant
2016-11-18 23:11:17 -05:00
committed by GitHub
2 changed files with 13 additions and 15 deletions

View File

@@ -357,4 +357,13 @@ impl<T> Match<T> {
Match::Whitelist(t) => Match::Whitelist(f(t)),
}
}
/// Return the match if it is not none. Otherwise, return other.
pub fn or(self, other: Self) -> Self {
if self.is_none() {
other
} else {
self
}
}
}