diff options
| author | Maybe Waffle <waffle.lapkin@gmail.com> | 2023-05-24 14:33:43 +0000 |
|---|---|---|
| committer | Maybe Waffle <waffle.lapkin@gmail.com> | 2023-05-24 14:33:43 +0000 |
| commit | 307799a711826294bc2b3e562cd87bf1e2ff28b4 (patch) | |
| tree | 1aa6b91ab277015585998e92e9be35f80331d7a2 /compiler/rustc_errors | |
| parent | fb0f74a8c9e8b8f488ec5894d5d314caebf4c662 (diff) | |
| download | rust-307799a711826294bc2b3e562cd87bf1e2ff28b4.tar.gz rust-307799a711826294bc2b3e562cd87bf1e2ff28b4.zip | |
Use `is_some_and`/`is_ok_and` in less obvious spots
Diffstat (limited to 'compiler/rustc_errors')
| -rw-r--r-- | compiler/rustc_errors/src/emitter.rs | 14 |
1 files changed, 5 insertions, 9 deletions
diff --git a/compiler/rustc_errors/src/emitter.rs b/compiler/rustc_errors/src/emitter.rs index 3e38d6afb0b..6d944e51314 100644 --- a/compiler/rustc_errors/src/emitter.rs +++ b/compiler/rustc_errors/src/emitter.rs @@ -285,15 +285,11 @@ pub trait Emitter: Translate { format!( "help: {}{}: `{}`", &msg, - if self - .source_map() - .map(|sm| is_case_difference( - sm, - substitution, - sugg.substitutions[0].parts[0].span, - )) - .unwrap_or(false) - { + if self.source_map().is_some_and(|sm| is_case_difference( + sm, + substitution, + sugg.substitutions[0].parts[0].span, + )) { " (notice the capitalization)" } else { "" |
