mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-09-30 13:51:31 +00:00
Some clippy fixes for 1.36
This commit is contained in:
parent
c6a6e43372
commit
4ad9e986ad
31 changed files with 62 additions and 70 deletions
|
@ -72,8 +72,8 @@ impl salsa::ParallelDatabase for RootDatabase {
|
|||
fn snapshot(&self) -> salsa::Snapshot<RootDatabase> {
|
||||
salsa::Snapshot::new(RootDatabase {
|
||||
runtime: self.runtime.snapshot(self),
|
||||
last_gc: self.last_gc.clone(),
|
||||
last_gc_check: self.last_gc_check.clone(),
|
||||
last_gc: self.last_gc,
|
||||
last_gc_check: self.last_gc_check,
|
||||
})
|
||||
}
|
||||
}
|
||||
|
|
|
@ -25,7 +25,7 @@ pub fn file_structure(file: &SourceFile) -> Vec<StructureNode> {
|
|||
match event {
|
||||
WalkEvent::Enter(node) => {
|
||||
if let Some(mut symbol) = structure_node(node) {
|
||||
symbol.parent = stack.last().map(|&n| n);
|
||||
symbol.parent = stack.last().copied();
|
||||
stack.push(res.len());
|
||||
res.push(symbol);
|
||||
}
|
||||
|
|
|
@ -137,7 +137,7 @@ impl<'a> Edits<'a> {
|
|||
Step::Newline(n) => n,
|
||||
Step::Utf16Char(r) => r.end(),
|
||||
};
|
||||
let res = match &mut self.current {
|
||||
match &mut self.current {
|
||||
Some(edit) => {
|
||||
if step_pos <= edit.delete.start() {
|
||||
NextSteps::Use
|
||||
|
@ -155,8 +155,7 @@ impl<'a> Edits<'a> {
|
|||
}
|
||||
}
|
||||
None => NextSteps::Use,
|
||||
};
|
||||
res
|
||||
}
|
||||
}
|
||||
|
||||
fn translate_range(&self, range: TextRange) -> TextRange {
|
||||
|
|
|
@ -87,7 +87,7 @@ pub(crate) fn world_symbols(db: &RootDatabase, query: Query) -> Vec<FileSymbol>
|
|||
let mut files = Vec::new();
|
||||
for &root in db.local_roots().iter() {
|
||||
let sr = db.source_root(root);
|
||||
files.extend(sr.files.values().map(|&it| it))
|
||||
files.extend(sr.files.values().copied())
|
||||
}
|
||||
|
||||
let snap = Snap(db.snapshot());
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue