From 2b444672e10d1a019c194729b9e4800d39904459 Mon Sep 17 00:00:00 2001 From: Oli Scherer Date: Tue, 25 Jul 2023 10:27:34 +0000 Subject: Use a builder instead of boolean/option arguments --- src/tools/clippy/clippy_lints/src/doc.rs | 2 +- src/tools/rustfmt/src/parse/session.rs | 5 +---- 2 files changed, 2 insertions(+), 5 deletions(-) (limited to 'src/tools') diff --git a/src/tools/clippy/clippy_lints/src/doc.rs b/src/tools/clippy/clippy_lints/src/doc.rs index 8879c529262..00f70e586f4 100644 --- a/src/tools/clippy/clippy_lints/src/doc.rs +++ b/src/tools/clippy/clippy_lints/src/doc.rs @@ -729,7 +729,7 @@ fn check_code(cx: &LateContext<'_>, text: &str, edition: Edition, span: Span) { false, TerminalUrl::No, ); - let handler = Handler::with_emitter(false, None, Box::new(emitter), None); + let handler = Handler::with_emitter(Box::new(emitter)).disable_warnings(); let sess = ParseSess::with_span_handler(handler, sm); let mut parser = match maybe_new_parser_from_source_str(&sess, filename, code) { diff --git a/src/tools/rustfmt/src/parse/session.rs b/src/tools/rustfmt/src/parse/session.rs index 92d2425cd3b..6ce68c2c2fb 100644 --- a/src/tools/rustfmt/src/parse/session.rs +++ b/src/tools/rustfmt/src/parse/session.rs @@ -153,8 +153,6 @@ fn default_handler( )) }; Handler::with_emitter( - true, - None, Box::new(SilentOnIgnoredFilesEmitter { has_non_ignorable_parser_errors: false, source_map, @@ -162,7 +160,6 @@ fn default_handler( ignore_path_set, can_reset, }), - None, ) } @@ -234,7 +231,7 @@ impl ParseSess { } pub(crate) fn set_silent_emitter(&mut self) { - self.parse_sess.span_diagnostic = Handler::with_emitter(true, None, silent_emitter(), None); + self.parse_sess.span_diagnostic = Handler::with_emitter(silent_emitter()); } pub(crate) fn span_to_filename(&self, span: Span) -> FileName { -- cgit 1.4.1-3-g733a5