Skip to content

Commit 68c0ba2

Browse files
Rename JsonDumper to Dumper
The Dumper no longer has anything to do specifically with JSON, it merely represents processing into an `Analysis` output.
1 parent eb4fbda commit 68c0ba2

File tree

3 files changed

+15
-15
lines changed

3 files changed

+15
-15
lines changed

src/librustc_save_analysis/dump_visitor.rs

+4-4
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
//!
1111
//! SpanUtils is used to manipulate spans. In particular, to extract sub-spans
1212
//! from spans (e.g., the span for `bar` from the above example path).
13-
//! DumpVisitor walks the AST and processes it, and JsonDumper is used for
13+
//! DumpVisitor walks the AST and processes it, and Dumper is used for
1414
//! recording the output.
1515
1616
use rustc::hir::def::{Res, DefKind as HirDefKind};
@@ -38,7 +38,7 @@ use syntax_pos::*;
3838

3939
use crate::{escape, generated_code, id_from_def_id, id_from_node_id, lower_attributes,
4040
PathCollector, SaveContext};
41-
use crate::json_dumper::{Access, JsonDumper};
41+
use crate::dumper::{Access, Dumper};
4242
use crate::span_utils::SpanUtils;
4343
use crate::sig;
4444

@@ -78,7 +78,7 @@ macro_rules! access_from_vis {
7878
pub struct DumpVisitor<'l, 'tcx, 'll> {
7979
save_ctxt: SaveContext<'l, 'tcx>,
8080
tcx: TyCtxt<'tcx>,
81-
dumper: &'ll mut JsonDumper,
81+
dumper: &'ll mut Dumper,
8282

8383
span: SpanUtils<'l>,
8484

@@ -95,7 +95,7 @@ pub struct DumpVisitor<'l, 'tcx, 'll> {
9595
impl<'l, 'tcx, 'll> DumpVisitor<'l, 'tcx, 'll> {
9696
pub fn new(
9797
save_ctxt: SaveContext<'l, 'tcx>,
98-
dumper: &'ll mut JsonDumper,
98+
dumper: &'ll mut Dumper,
9999
) -> DumpVisitor<'l, 'tcx, 'll> {
100100
let span_utils = SpanUtils::new(&save_ctxt.tcx.sess);
101101
DumpVisitor {

src/librustc_save_analysis/json_dumper.rs renamed to src/librustc_save_analysis/dumper.rs

+5-5
Original file line numberDiff line numberDiff line change
@@ -9,14 +9,14 @@ pub struct Access {
99
pub public: bool,
1010
}
1111

12-
pub struct JsonDumper {
12+
pub struct Dumper {
1313
result: Analysis,
1414
config: Config,
1515
}
1616

17-
impl JsonDumper {
18-
pub fn new(config: Config) -> JsonDumper {
19-
JsonDumper {
17+
impl Dumper {
18+
pub fn new(config: Config) -> Dumper {
19+
Dumper {
2020
config: config.clone(),
2121
result: Analysis::new(config),
2222
}
@@ -27,7 +27,7 @@ impl JsonDumper {
2727
}
2828
}
2929

30-
impl JsonDumper {
30+
impl Dumper {
3131
pub fn crate_prelude(&mut self, data: CratePreludeData) {
3232
self.result.prelude = Some(data)
3333
}

src/librustc_save_analysis/lib.rs

+6-6
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
#![recursion_limit="256"]
88

99

10-
mod json_dumper;
10+
mod dumper;
1111
mod dump_visitor;
1212
#[macro_use]
1313
mod span_utils;
@@ -39,7 +39,7 @@ use syntax::visit::{self, Visitor};
3939
use syntax::print::pprust::{arg_to_string, ty_to_string};
4040
use syntax_pos::*;
4141

42-
use json_dumper::JsonDumper;
42+
use dumper::Dumper;
4343
use dump_visitor::DumpVisitor;
4444
use span_utils::SpanUtils;
4545

@@ -1076,7 +1076,7 @@ impl<'a> SaveHandler for DumpHandler<'a> {
10761076
) {
10771077
let sess = &save_ctxt.tcx.sess;
10781078
let (output, file_name) = self.output_file(&save_ctxt);
1079-
let mut dumper = JsonDumper::new(save_ctxt.config.clone());
1079+
let mut dumper = Dumper::new(save_ctxt.config.clone());
10801080
let mut visitor = DumpVisitor::new(save_ctxt, &mut dumper);
10811081

10821082
visitor.dump_crate_info(cratename, krate);
@@ -1109,12 +1109,12 @@ impl<'b> SaveHandler for CallbackHandler<'b> {
11091109
cratename: &str,
11101110
input: &'l Input,
11111111
) {
1112-
// We're using the JsonDumper here because it has the format of the
1112+
// We're using the Dumper here because it has the format of the
11131113
// save-analysis results that we will pass to the callback. IOW, we are
1114-
// using the JsonDumper to collect the save-analysis results, but not
1114+
// using the Dumper to collect the save-analysis results, but not
11151115
// actually to dump them to a file. This is all a bit convoluted and
11161116
// there is certainly a simpler design here trying to get out (FIXME).
1117-
let mut dumper = JsonDumper::new(save_ctxt.config.clone());
1117+
let mut dumper = Dumper::new(save_ctxt.config.clone());
11181118
let mut visitor = DumpVisitor::new(save_ctxt, &mut dumper);
11191119

11201120
visitor.dump_crate_info(cratename, krate);

0 commit comments

Comments
 (0)