From ca5b79ddf7325fa7f6a88c170edbffa1757b149e Mon Sep 17 00:00:00 2001 From: Nicholas Nethercote Date: Thu, 29 Feb 2024 13:55:16 +1100 Subject: Remove unnecessary `output` local variable. --- compiler/rustc_errors/src/json.rs | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) (limited to 'compiler/rustc_errors/src') 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), } } -- cgit 1.4.1-3-g733a5