about summary refs log tree commit diff
path: root/compiler/rustc_errors/src/json.rs
diff options
context:
space:
mode:
authorEzra Shaw <ezrasure@outlook.com>2023-02-25 20:14:10 +1300
committerEzra Shaw <ezrasure@outlook.com>2023-02-26 20:12:36 +1300
commit90677edcba063ee83316ef109e0fe54116015575 (patch)
tree2ccfefb0af2241e8b52e20bfea7a09b44b07c20d /compiler/rustc_errors/src/json.rs
parent70fd012439d75fd6ce561a6518b9b8fd399f455f (diff)
downloadrust-90677edcba063ee83316ef109e0fe54116015575.tar.gz
rust-90677edcba063ee83316ef109e0fe54116015575.zip
refactor: statically guarantee that current error codes are documented
Diffstat (limited to 'compiler/rustc_errors/src/json.rs')
-rw-r--r--compiler/rustc_errors/src/json.rs2
1 files changed, 1 insertions, 1 deletions
diff --git a/compiler/rustc_errors/src/json.rs b/compiler/rustc_errors/src/json.rs
index e475fc725c3..f32d6b96b9b 100644
--- a/compiler/rustc_errors/src/json.rs
+++ b/compiler/rustc_errors/src/json.rs
@@ -580,7 +580,7 @@ impl DiagnosticCode {
             let je_result =
                 je.registry.as_ref().map(|registry| registry.try_find_description(&s)).unwrap();
 
-            DiagnosticCode { code: s, explanation: je_result.unwrap_or(None) }
+            DiagnosticCode { code: s, explanation: je_result.ok() }
         })
     }
 }