Skip to content

Commit 9efb6ea

Browse files
committed
Rust: Cargo fmt.
1 parent 83df113 commit 9efb6ea

File tree

2 files changed

+15
-47
lines changed

2 files changed

+15
-47
lines changed

rust/extractor/src/main.rs

Lines changed: 5 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -50,12 +50,7 @@ impl<'a> Extractor<'a> {
5050
}
5151
}
5252

53-
fn extract(
54-
&mut self,
55-
rust_analyzer: &RustAnalyzer,
56-
file: &Path,
57-
source_kind: SourceKind,
58-
) {
53+
fn extract(&mut self, rust_analyzer: &RustAnalyzer, file: &Path, source_kind: SourceKind) {
5954
self.archiver.archive(file);
6055
let before_parse = Instant::now();
6156
let ParseResult {
@@ -118,11 +113,7 @@ impl<'a> Extractor<'a> {
118113
vfs: &Vfs,
119114
source_kind: SourceKind,
120115
) {
121-
self.extract(
122-
&RustAnalyzer::new(vfs, semantics),
123-
file,
124-
source_kind,
125-
);
116+
self.extract(&RustAnalyzer::new(vfs, semantics), file, source_kind);
126117
}
127118

128119
pub fn extract_without_semantics(
@@ -131,11 +122,7 @@ impl<'a> Extractor<'a> {
131122
source_kind: SourceKind,
132123
err: RustAnalyzerNoSemantics,
133124
) {
134-
self.extract(
135-
&RustAnalyzer::from(err),
136-
file,
137-
source_kind,
138-
);
125+
self.extract(&RustAnalyzer::from(err), file, source_kind);
139126
}
140127

141128
pub fn load_manifest(
@@ -308,12 +295,7 @@ fn main() -> anyhow::Result<()> {
308295
let semantics = Semantics::new(db);
309296
for file in files {
310297
match extractor.load_source(file, &semantics, vfs) {
311-
Ok(()) => extractor.extract_with_semantics(
312-
file,
313-
&semantics,
314-
vfs,
315-
source_mode,
316-
),
298+
Ok(()) => extractor.extract_with_semantics(file, &semantics, vfs, source_mode),
317299
Err(e) => extractor.extract_without_semantics(file, source_mode, e),
318300
};
319301
}
@@ -326,12 +308,7 @@ fn main() -> anyhow::Result<()> {
326308
.source_root(db)
327309
.is_library
328310
{
329-
extractor.extract_with_semantics(
330-
file,
331-
&semantics,
332-
vfs,
333-
library_mode,
334-
);
311+
extractor.extract_with_semantics(file, &semantics, vfs, library_mode);
335312
extractor.archiver.archive(file);
336313
}
337314
}

rust/extractor/src/translate/base.rs

Lines changed: 10 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@ use crate::rust_analyzer::FileSemanticInformation;
44
use crate::trap::{DiagnosticSeverity, TrapFile, TrapId};
55
use crate::trap::{Label, TrapClass};
66
use ra_ap_base_db::EditionedFileId;
7-
use ra_ap_hir::db::ExpandDatabase;
87
use ra_ap_hir::Semantics;
8+
use ra_ap_hir::db::ExpandDatabase;
99
use ra_ap_hir_expand::{ExpandResult, ExpandTo, InFile};
1010
use ra_ap_ide_db::RootDatabase;
1111
use ra_ap_ide_db::line_index::{LineCol, LineIndex};
@@ -82,32 +82,23 @@ impl Emission<ast::Union> for Translator<'_> {
8282
}
8383
}
8484

85-
impl Emission<ast::Trait> for Translator<'_> {
86-
}
85+
impl Emission<ast::Trait> for Translator<'_> {}
8786

88-
impl Emission<ast::Module> for Translator<'_> {
89-
}
87+
impl Emission<ast::Module> for Translator<'_> {}
9088

91-
impl Emission<ast::Variant> for Translator<'_> {
92-
}
89+
impl Emission<ast::Variant> for Translator<'_> {}
9390

94-
impl Emission<ast::PathExpr> for Translator<'_> {
95-
}
91+
impl Emission<ast::PathExpr> for Translator<'_> {}
9692

97-
impl Emission<ast::RecordExpr> for Translator<'_> {
98-
}
93+
impl Emission<ast::RecordExpr> for Translator<'_> {}
9994

100-
impl Emission<ast::PathPat> for Translator<'_> {
101-
}
95+
impl Emission<ast::PathPat> for Translator<'_> {}
10296

103-
impl Emission<ast::RecordPat> for Translator<'_> {
104-
}
97+
impl Emission<ast::RecordPat> for Translator<'_> {}
10598

106-
impl Emission<ast::TupleStructPat> for Translator<'_> {
107-
}
99+
impl Emission<ast::TupleStructPat> for Translator<'_> {}
108100

109-
impl Emission<ast::MethodCallExpr> for Translator<'_> {
110-
}
101+
impl Emission<ast::MethodCallExpr> for Translator<'_> {}
111102

112103
impl Emission<ast::PathSegment> for Translator<'_> {
113104
fn post_emit(&mut self, node: &ast::PathSegment, label: Label<generated::PathSegment>) {

0 commit comments

Comments
 (0)