Skip to content

Commit ca5b79d

Browse files
committed
Remove unnecessary output local variable.
1 parent 805e50e commit ca5b79d

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

compiler/rustc_errors/src/json.rs

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -405,9 +405,8 @@ impl Diagnostic {
405405
.collect();
406406

407407
let buf = BufWriter::default();
408-
let output = buf.clone();
409408
je.json_rendered
410-
.new_emitter(Box::new(buf), je.fallback_bundle.clone())
409+
.new_emitter(Box::new(buf.clone()), je.fallback_bundle.clone())
411410
.sm(Some(je.sm.clone()))
412411
.fluent_bundle(je.fluent_bundle.clone())
413412
.diagnostic_width(je.diagnostic_width)
@@ -417,16 +416,16 @@ impl Diagnostic {
417416
.ui_testing(je.ui_testing)
418417
.ignored_directories_in_source_blocks(je.ignored_directories_in_source_blocks.clone())
419418
.emit_diagnostic(diag);
420-
let output = Arc::try_unwrap(output.0).unwrap().into_inner().unwrap();
421-
let output = String::from_utf8(output).unwrap();
419+
let buf = Arc::try_unwrap(buf.0).unwrap().into_inner().unwrap();
420+
let buf = String::from_utf8(buf).unwrap();
422421

423422
Diagnostic {
424423
message: translated_message.to_string(),
425424
code,
426425
level,
427426
spans,
428427
children,
429-
rendered: Some(output),
428+
rendered: Some(buf),
430429
}
431430
}
432431

0 commit comments

Comments
 (0)