summaryrefslogtreecommitdiff
path: root/cli/diagnostics.rs
diff options
context:
space:
mode:
authorKitson Kelly <me@kitsonkelly.com>2020-07-28 23:50:45 +1000
committerGitHub <noreply@github.com>2020-07-28 09:50:45 -0400
commit076547fbbb52b1df9d6db36dd72353bffa9e4a8b (patch)
tree82cd78b705c04b9b712f7220df9c964b54af19d9 /cli/diagnostics.rs
parentccd0d0eb79db6ad33095ca06e9d491a27379b87a (diff)
chore: use matches macro for bool matches (#6904)
Diffstat (limited to 'cli/diagnostics.rs')
-rw-r--r--cli/diagnostics.rs10
1 files changed, 2 insertions, 8 deletions
diff --git a/cli/diagnostics.rs b/cli/diagnostics.rs
index 401f77ea9..41ee5ec22 100644
--- a/cli/diagnostics.rs
+++ b/cli/diagnostics.rs
@@ -149,10 +149,7 @@ fn format_maybe_related_information(
for rd in related_information {
s.push_str("\n\n");
s.push_str(&format_stack(
- match rd.category {
- DiagnosticCategory::Error => true,
- _ => false,
- },
+ matches!(rd.category, DiagnosticCategory::Error),
&format_message(&rd.message_chain, &rd.message, 0),
rd.source_line.as_deref(),
rd.start_column,
@@ -177,10 +174,7 @@ impl fmt::Display for DiagnosticItem {
f,
"{}",
format_stack(
- match self.category {
- DiagnosticCategory::Error => true,
- _ => false,
- },
+ matches!(self.category, DiagnosticCategory::Error),
&format!(
"{}: {}",
format_category_and_code(&self.category, self.code),