Skip to content

Commit

Permalink
refactor: minor updates on pr feedback
Browse files Browse the repository at this point in the history
  • Loading branch information
calebcartwright committed Sep 20, 2019
1 parent 1cac774 commit 9588f46
Showing 1 changed file with 4 additions and 11 deletions.
15 changes: 4 additions & 11 deletions src/formatting.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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};

Expand Down Expand Up @@ -81,7 +81,7 @@ fn format_project<T: FormatHandler>(
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();
Expand Down Expand Up @@ -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)
Expand Down

0 comments on commit 9588f46

Please sign in to comment.