diff options
| author | Oli Scherer <git-spam-no-reply9815368754983@oli-obk.de> | 2023-07-25 13:25:38 +0000 |
|---|---|---|
| committer | Oli Scherer <git-spam-no-reply9815368754983@oli-obk.de> | 2023-07-31 09:34:30 +0000 |
| commit | 0e7ec9683dae0a0bc66797b1351059ed642f4e2d (patch) | |
| tree | 5c670cce44d13c300f1bdfe5b5de0c0729a32b5c /compiler/rustc_errors/src/json.rs | |
| parent | 29de70da1be1c71b89b006f9955fedc70e084067 (diff) | |
| download | rust-0e7ec9683dae0a0bc66797b1351059ed642f4e2d.tar.gz rust-0e7ec9683dae0a0bc66797b1351059ed642f4e2d.zip | |
Use builder pattern instead of lots of arguments for `EmitterWriter::new`
Diffstat (limited to 'compiler/rustc_errors/src/json.rs')
| -rw-r--r-- | compiler/rustc_errors/src/json.rs | 18 |
1 files changed, 7 insertions, 11 deletions
diff --git a/compiler/rustc_errors/src/json.rs b/compiler/rustc_errors/src/json.rs index 55f7c485024..e199244b1e4 100644 --- a/compiler/rustc_errors/src/json.rs +++ b/compiler/rustc_errors/src/json.rs @@ -359,17 +359,13 @@ impl Diagnostic { let buf = BufWriter::default(); let output = buf.clone(); je.json_rendered - .new_emitter( - Box::new(buf), - Some(je.sm.clone()), - je.fluent_bundle.clone(), - je.fallback_bundle.clone(), - false, - je.diagnostic_width, - je.macro_backtrace, - je.track_diagnostics, - je.terminal_url, - ) + .new_emitter(Box::new(buf), je.fallback_bundle.clone()) + .sm(Some(je.sm.clone())) + .fluent_bundle(je.fluent_bundle.clone()) + .diagnostic_width(je.diagnostic_width) + .macro_backtrace(je.macro_backtrace) + .track_diagnostics(je.track_diagnostics) + .terminal_url(je.terminal_url) .ui_testing(je.ui_testing) .emit_diagnostic(diag); let output = Arc::try_unwrap(output.0).unwrap().into_inner().unwrap(); |
