Skip to content

Commit 2007157

Browse files
author
Paolo Tranquilli
committed
Rust: fix no_semantics_reason
1 parent 2987743 commit 2007157

File tree

1 file changed

+7
-8
lines changed

1 file changed

+7
-8
lines changed

rust/extractor/src/rust_analyzer.rs

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ impl<'a> RustAnalyzer<'a> {
7373
RustAnalyzer::WithSemantics { vfs, semantics }
7474
}
7575
pub fn parse(&self, path: &Path) -> ParseResult {
76-
let mut no_semantics_reason = "";
76+
let no_semantics_reason;
7777
match self {
7878
RustAnalyzer::WithSemantics { vfs, semantics } => {
7979
if let Some(file_id) = path_to_file_id(path, vfs) {
@@ -94,15 +94,14 @@ impl<'a> RustAnalyzer<'a> {
9494
errors,
9595
semantics_info: Ok(FileSemanticInformation { file_id, semantics }),
9696
};
97-
} else {
98-
debug!(
99-
"No text available for file_id '{:?}', falling back to loading file '{}' from disk.",
100-
file_id,
101-
path.to_string_lossy()
102-
);
103-
no_semantics_reason = "file not found in project";
10497
}
98+
debug!(
99+
"No text available for file_id '{:?}', falling back to loading file '{}' from disk.",
100+
file_id,
101+
path.to_string_lossy()
102+
);
105103
}
104+
no_semantics_reason = "file not found in project";
106105
}
107106
RustAnalyzer::WithoutSemantics { reason } => {
108107
no_semantics_reason = reason;

0 commit comments

Comments
 (0)