diff options
| author | Maybe Waffle <waffle.lapkin@gmail.com> | 2023-05-24 14:19:22 +0000 |
|---|---|---|
| committer | Maybe Waffle <waffle.lapkin@gmail.com> | 2023-05-24 14:20:41 +0000 |
| commit | fb0f74a8c9e8b8f488ec5894d5d314caebf4c662 (patch) | |
| tree | 4cab4cc84de840cc4cce01f3627a979fed59c54c /compiler/rustc_errors | |
| parent | 70db8369226c4d2386b25d66a49c8989247934bf (diff) | |
| download | rust-fb0f74a8c9e8b8f488ec5894d5d314caebf4c662.tar.gz rust-fb0f74a8c9e8b8f488ec5894d5d314caebf4c662.zip | |
Use `Option::is_some_and` and `Result::is_ok_and` in the compiler
Diffstat (limited to 'compiler/rustc_errors')
| -rw-r--r-- | compiler/rustc_errors/src/lib.rs | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/compiler/rustc_errors/src/lib.rs b/compiler/rustc_errors/src/lib.rs index 074fbb1322c..3dec0d9299c 100644 --- a/compiler/rustc_errors/src/lib.rs +++ b/compiler/rustc_errors/src/lib.rs @@ -1437,7 +1437,7 @@ impl HandlerInner { } fn treat_err_as_bug(&self) -> bool { - self.flags.treat_err_as_bug.map_or(false, |c| { + self.flags.treat_err_as_bug.is_some_and(|c| { self.err_count() + self.lint_err_count + self.delayed_bug_count() >= c.get() }) } @@ -1603,7 +1603,7 @@ impl HandlerInner { // This is technically `self.treat_err_as_bug()` but `delay_span_bug` is called before // incrementing `err_count` by one, so we need to +1 the comparing. // FIXME: Would be nice to increment err_count in a more coherent way. - if self.flags.treat_err_as_bug.map_or(false, |c| { + if self.flags.treat_err_as_bug.is_some_and(|c| { self.err_count() + self.lint_err_count + self.delayed_bug_count() + 1 >= c.get() }) { // FIXME: don't abort here if report_delayed_bugs is off |
