Use is_some_and/is_ok_and in less obvious spots

This commit is contained in:
Maybe Waffle 2023-05-24 14:33:43 +00:00
parent fb0f74a8c9
commit 307799a711
19 changed files with 53 additions and 88 deletions

View file

@ -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 {
""