mirror of
https://github.com/github/codeql.git
synced 2025-12-16 16:53:25 +01:00
Rust: Cargo fmt.
This commit is contained in:
@@ -50,12 +50,7 @@ impl<'a> Extractor<'a> {
|
||||
}
|
||||
}
|
||||
|
||||
fn extract(
|
||||
&mut self,
|
||||
rust_analyzer: &RustAnalyzer,
|
||||
file: &Path,
|
||||
source_kind: SourceKind,
|
||||
) {
|
||||
fn extract(&mut self, rust_analyzer: &RustAnalyzer, file: &Path, source_kind: SourceKind) {
|
||||
self.archiver.archive(file);
|
||||
let before_parse = Instant::now();
|
||||
let ParseResult {
|
||||
@@ -118,11 +113,7 @@ impl<'a> Extractor<'a> {
|
||||
vfs: &Vfs,
|
||||
source_kind: SourceKind,
|
||||
) {
|
||||
self.extract(
|
||||
&RustAnalyzer::new(vfs, semantics),
|
||||
file,
|
||||
source_kind,
|
||||
);
|
||||
self.extract(&RustAnalyzer::new(vfs, semantics), file, source_kind);
|
||||
}
|
||||
|
||||
pub fn extract_without_semantics(
|
||||
@@ -131,11 +122,7 @@ impl<'a> Extractor<'a> {
|
||||
source_kind: SourceKind,
|
||||
err: RustAnalyzerNoSemantics,
|
||||
) {
|
||||
self.extract(
|
||||
&RustAnalyzer::from(err),
|
||||
file,
|
||||
source_kind,
|
||||
);
|
||||
self.extract(&RustAnalyzer::from(err), file, source_kind);
|
||||
}
|
||||
|
||||
pub fn load_manifest(
|
||||
@@ -308,12 +295,7 @@ fn main() -> anyhow::Result<()> {
|
||||
let semantics = Semantics::new(db);
|
||||
for file in files {
|
||||
match extractor.load_source(file, &semantics, vfs) {
|
||||
Ok(()) => extractor.extract_with_semantics(
|
||||
file,
|
||||
&semantics,
|
||||
vfs,
|
||||
source_mode,
|
||||
),
|
||||
Ok(()) => extractor.extract_with_semantics(file, &semantics, vfs, source_mode),
|
||||
Err(e) => extractor.extract_without_semantics(file, source_mode, e),
|
||||
};
|
||||
}
|
||||
@@ -326,12 +308,7 @@ fn main() -> anyhow::Result<()> {
|
||||
.source_root(db)
|
||||
.is_library
|
||||
{
|
||||
extractor.extract_with_semantics(
|
||||
file,
|
||||
&semantics,
|
||||
vfs,
|
||||
library_mode,
|
||||
);
|
||||
extractor.extract_with_semantics(file, &semantics, vfs, library_mode);
|
||||
extractor.archiver.archive(file);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -4,8 +4,8 @@ use crate::rust_analyzer::FileSemanticInformation;
|
||||
use crate::trap::{DiagnosticSeverity, TrapFile, TrapId};
|
||||
use crate::trap::{Label, TrapClass};
|
||||
use ra_ap_base_db::EditionedFileId;
|
||||
use ra_ap_hir::db::ExpandDatabase;
|
||||
use ra_ap_hir::Semantics;
|
||||
use ra_ap_hir::db::ExpandDatabase;
|
||||
use ra_ap_hir_expand::{ExpandResult, ExpandTo, InFile};
|
||||
use ra_ap_ide_db::RootDatabase;
|
||||
use ra_ap_ide_db::line_index::{LineCol, LineIndex};
|
||||
@@ -82,32 +82,23 @@ impl Emission<ast::Union> for Translator<'_> {
|
||||
}
|
||||
}
|
||||
|
||||
impl Emission<ast::Trait> for Translator<'_> {
|
||||
}
|
||||
impl Emission<ast::Trait> for Translator<'_> {}
|
||||
|
||||
impl Emission<ast::Module> for Translator<'_> {
|
||||
}
|
||||
impl Emission<ast::Module> for Translator<'_> {}
|
||||
|
||||
impl Emission<ast::Variant> for Translator<'_> {
|
||||
}
|
||||
impl Emission<ast::Variant> for Translator<'_> {}
|
||||
|
||||
impl Emission<ast::PathExpr> for Translator<'_> {
|
||||
}
|
||||
impl Emission<ast::PathExpr> for Translator<'_> {}
|
||||
|
||||
impl Emission<ast::RecordExpr> for Translator<'_> {
|
||||
}
|
||||
impl Emission<ast::RecordExpr> for Translator<'_> {}
|
||||
|
||||
impl Emission<ast::PathPat> for Translator<'_> {
|
||||
}
|
||||
impl Emission<ast::PathPat> for Translator<'_> {}
|
||||
|
||||
impl Emission<ast::RecordPat> for Translator<'_> {
|
||||
}
|
||||
impl Emission<ast::RecordPat> for Translator<'_> {}
|
||||
|
||||
impl Emission<ast::TupleStructPat> for Translator<'_> {
|
||||
}
|
||||
impl Emission<ast::TupleStructPat> for Translator<'_> {}
|
||||
|
||||
impl Emission<ast::MethodCallExpr> for Translator<'_> {
|
||||
}
|
||||
impl Emission<ast::MethodCallExpr> for Translator<'_> {}
|
||||
|
||||
impl Emission<ast::PathSegment> for Translator<'_> {
|
||||
fn post_emit(&mut self, node: &ast::PathSegment, label: Label<generated::PathSegment>) {
|
||||
|
||||
Reference in New Issue
Block a user