From 9588f46ca6f3890112b384b25835c50f20564b47 Mon Sep 17 00:00:00 2001 From: calebcartwright Date: Fri, 20 Sep 2019 17:48:07 -0500 Subject: [PATCH] refactor: minor updates on pr feedback --- src/formatting.rs | 15 ++++----------- 1 file changed, 4 insertions(+), 11 deletions(-) diff --git a/src/formatting.rs b/src/formatting.rs index 43416224bf1..21104242148 100644 --- a/src/formatting.rs +++ b/src/formatting.rs @@ -9,7 +9,7 @@ use std::time::{Duration, Instant}; use syntax::ast; use syntax::errors::emitter::{ColorConfig, Emitter, EmitterWriter}; -use syntax::errors::{DiagnosticBuilder, Handler, HandlerFlags}; +use syntax::errors::{DiagnosticBuilder, Handler}; use syntax::parse::{self, ParseSess}; use syntax::source_map::{FilePathMapping, SourceMap, Span, DUMMY_SP}; @@ -81,7 +81,7 @@ fn format_project( let mut parse_session = make_parse_sess( source_map.clone(), config, - ignore_path_set.clone(), + Rc::clone(&ignore_path_set), can_reset.clone(), ); let mut report = FormatReport::new(); @@ -774,18 +774,11 @@ fn make_parse_sess( has_non_ignorable_parser_errors: false, can_reset: false, ignore_path_set: ignore_path_set, - source_map: source_map.clone(), + source_map: Rc::clone(&source_map), emitter: emitter_writer, parser_error_resetter, }); - Handler::with_emitter_and_flags( - emitter, - HandlerFlags { - can_emit_warnings: false, - treat_err_as_bug: None, - ..Default::default() - }, - ) + Handler::with_emitter(true, None, emitter) }; ParseSess::with_span_handler(tty_handler, source_map)