Use chaining for DiagnosticBuilder construction and emit.

To avoid the use of a mutable local variable, and because it reads more
nicely.
This commit is contained in:
Nicholas Nethercote
2024-01-03 17:03:10 +11:00
parent 589591efde
commit bd4e623485
22 changed files with 193 additions and 183 deletions

View File

@@ -357,7 +357,6 @@ pub fn struct_lint_level(
if let Level::Expect(_) = level {
let name = lint.name_lower();
err.code(DiagnosticId::Lint { name, has_future_breakage, is_force_warn: false });
decorate(&mut err);
err.emit();
return;