1
Fork 0

Rollup merge of #113084 - WaffleLapkin:less_map_or, r=Nilstrieb

Simplify some conditions

r? `@Nilstrieb`

Some things taken out of my `is_none_or` pr.
This commit is contained in:
Matthias Krüger 2023-06-27 22:10:15 +02:00 committed by GitHub
commit d505582ce2
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
11 changed files with 35 additions and 45 deletions

View file

@ -51,13 +51,6 @@ impl GatedSpans {
debug_assert_eq!(span, removed_span);
}
/// Is the provided `feature` gate ungated currently?
///
/// Using this is discouraged unless you have a really good reason to.
pub fn is_ungated(&self, feature: Symbol) -> bool {
self.spans.borrow().get(&feature).map_or(true, |spans| spans.is_empty())
}
/// Prepend the given set of `spans` onto the set in `self`.
pub fn merge(&self, mut spans: FxHashMap<Symbol, Vec<Span>>) {
let mut inner = self.spans.borrow_mut();