diff options
| author | Nicholas Nethercote <n.nethercote@gmail.com> | 2024-02-29 13:55:16 +1100 |
|---|---|---|
| committer | Nicholas Nethercote <n.nethercote@gmail.com> | 2024-02-29 16:30:12 +1100 |
| commit | ca5b79ddf7325fa7f6a88c170edbffa1757b149e (patch) | |
| tree | f5aa2311c62b897b71d6bb3fabac37240317af46 /compiler/rustc_errors/src/json.rs | |
| parent | 805e50e71bfdb870011b4bb128929c6103af602f (diff) | |
| download | rust-ca5b79ddf7325fa7f6a88c170edbffa1757b149e.tar.gz rust-ca5b79ddf7325fa7f6a88c170edbffa1757b149e.zip | |
Remove unnecessary `output` local variable.
Diffstat (limited to 'compiler/rustc_errors/src/json.rs')
| -rw-r--r-- | compiler/rustc_errors/src/json.rs | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/compiler/rustc_errors/src/json.rs b/compiler/rustc_errors/src/json.rs index 35030638f4c..94d0c5d060e 100644 --- a/compiler/rustc_errors/src/json.rs +++ b/compiler/rustc_errors/src/json.rs @@ -405,9 +405,8 @@ impl Diagnostic { .collect(); let buf = BufWriter::default(); - let output = buf.clone(); je.json_rendered - .new_emitter(Box::new(buf), je.fallback_bundle.clone()) + .new_emitter(Box::new(buf.clone()), je.fallback_bundle.clone()) .sm(Some(je.sm.clone())) .fluent_bundle(je.fluent_bundle.clone()) .diagnostic_width(je.diagnostic_width) @@ -417,8 +416,8 @@ impl Diagnostic { .ui_testing(je.ui_testing) .ignored_directories_in_source_blocks(je.ignored_directories_in_source_blocks.clone()) .emit_diagnostic(diag); - let output = Arc::try_unwrap(output.0).unwrap().into_inner().unwrap(); - let output = String::from_utf8(output).unwrap(); + let buf = Arc::try_unwrap(buf.0).unwrap().into_inner().unwrap(); + let buf = String::from_utf8(buf).unwrap(); Diagnostic { message: translated_message.to_string(), @@ -426,7 +425,7 @@ impl Diagnostic { level, spans, children, - rendered: Some(output), + rendered: Some(buf), } } |
