mirror of
https://github.com/rust-lang/rust.git
synced 2024-11-25 16:24:46 +00:00
compiler: use is_none_or
where it is clearly better
heuristic was: if it easily allows removing bangs entirely? worth it. if it requires more effort or just moves the bang? not.
This commit is contained in:
parent
dd5127615a
commit
47cfaa6d87
@ -184,11 +184,11 @@ impl<'a, 'ra, 'tcx> UnusedImportCheckVisitor<'a, 'ra, 'tcx> {
|
|||||||
|
|
||||||
// If the extern crate isn't in the extern prelude,
|
// If the extern crate isn't in the extern prelude,
|
||||||
// there is no way it can be written as a `use`.
|
// there is no way it can be written as a `use`.
|
||||||
if !self
|
if self
|
||||||
.r
|
.r
|
||||||
.extern_prelude
|
.extern_prelude
|
||||||
.get(&extern_crate.ident)
|
.get(&extern_crate.ident)
|
||||||
.is_some_and(|entry| !entry.introduced_by_item)
|
.is_none_or(|entry| entry.introduced_by_item)
|
||||||
{
|
{
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
@ -714,7 +714,7 @@ impl<D: Delegate<Cx = X>, X: Cx> SearchGraph<D> {
|
|||||||
// current goal is already part of the same cycle. This check could be
|
// current goal is already part of the same cycle. This check could be
|
||||||
// improved but seems to be good enough for now.
|
// improved but seems to be good enough for now.
|
||||||
let last = self.stack.raw.last().unwrap();
|
let last = self.stack.raw.last().unwrap();
|
||||||
if !last.heads.opt_lowest_cycle_head().is_some_and(|lowest| lowest <= head) {
|
if last.heads.opt_lowest_cycle_head().is_none_or(|lowest| lowest > head) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user