Skip to content

Commit 896e673

Browse files
committed
clippy
1 parent 6413e2f commit 896e673

File tree

7 files changed

+9
-9
lines changed

7 files changed

+9
-9
lines changed

crates/hir-expand/src/change.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
//! Defines a unit of change that can applied to the database to get the next
22
//! state. Changes are transactional.
33
use base_db::{
4-
CrateGraph, CrateId, CrateWorkspaceData, FileChange, RootQueryDb, SourceDatabase, SourceRoot,
4+
CrateGraph, CrateId, CrateWorkspaceData, FileChange, SourceRoot,
55
};
66
use rustc_hash::FxHashMap;
77
use salsa::Durability;
@@ -21,7 +21,7 @@ impl ChangeWithProcMacros {
2121
Self::default()
2222
}
2323

24-
pub fn apply(self, db: &mut (impl ExpandDatabase + SourceDatabase + RootQueryDb)) {
24+
pub fn apply(self, db: &mut impl ExpandDatabase) {
2525
self.source_change.apply(db);
2626
if let Some(proc_macros) = self.proc_macros {
2727
db.set_proc_macros_with_durability(Arc::new(proc_macros), Durability::HIGH);

crates/hir-expand/src/hygiene.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -226,7 +226,7 @@ pub(crate) fn dump_syntax_contexts(db: &dyn ExpandDatabase) -> String {
226226

227227
impl std::fmt::Debug for SyntaxContextDebug<'_> {
228228
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
229-
fancy_debug(&self.1, self.0, f)
229+
fancy_debug(self.1, self.0, f)
230230
}
231231
}
232232

crates/hir/src/semantics/source_to_def.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -179,7 +179,7 @@ impl SourceToDefCtx<'_, '_> {
179179
let mut mods = SmallVec::new();
180180

181181
for &crate_id in
182-
Upcast::<dyn RootQueryDb>::upcast(self.db).relevant_crates(file.into()).iter()
182+
Upcast::<dyn RootQueryDb>::upcast(self.db).relevant_crates(file).iter()
183183
{
184184
// Note: `mod` declarations in block modules cannot be supported here
185185
let crate_def_map = self.db.crate_def_map(crate_id);

crates/ide-diagnostics/src/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -339,7 +339,7 @@ pub fn syntax_diagnostics(
339339
Diagnostic::new(
340340
DiagnosticCode::SyntaxError,
341341
format!("Syntax Error: {err}"),
342-
FileRange { file_id: file_id.into(), range: err.range() },
342+
FileRange { file_id, range: err.range() },
343343
)
344344
})
345345
.collect()

crates/rust-analyzer/src/cli/run_tests.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ impl flags::RunTests {
4040
None => " (unknown line col)".to_owned(),
4141
Some(x) => format!("#{}:{}", x.line + 1, x.col),
4242
};
43-
let source_root = db.file_source_root(file_id.into()).source_root_id(db);
43+
let source_root = db.file_source_root(file_id).source_root_id(db);
4444
let source_root = db.source_root(source_root).source_root(db);
4545

4646
let path = source_root.path_for_file(&file_id).map(|x| x.to_string());

crates/rust-analyzer/src/handlers/request.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1319,7 +1319,7 @@ pub(crate) fn handle_rename(
13191319
{
13201320
for op in ops {
13211321
if let lsp_types::DocumentChangeOperation::Op(doc_change_op) = op {
1322-
resource_ops_supported(&snap.config, resolve_resource_op(&doc_change_op))?
1322+
resource_ops_supported(&snap.config, resolve_resource_op(doc_change_op))?
13231323
}
13241324
}
13251325
}
@@ -1442,7 +1442,7 @@ pub(crate) fn handle_code_action(
14421442
if let Some(changes) = changes {
14431443
for change in changes {
14441444
if let lsp_ext::SnippetDocumentChangeOperation::Op(res_op) = change {
1445-
resource_ops_supported(&snap.config, resolve_resource_op(&res_op))?
1445+
resource_ops_supported(&snap.config, resolve_resource_op(res_op))?
14461446
}
14471447
}
14481448
}

crates/span/src/hygiene.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -187,7 +187,7 @@ const _: () = {
187187
outer_transparency,
188188
edition,
189189
parent,
190-
std::marker::PhantomData::default(),
190+
std::marker::PhantomData,
191191
),
192192
|id, data| SyntaxContextUnderlyingData {
193193
outer_expn: zalsa_::interned::Lookup::into_owned(data.0),

0 commit comments

Comments
 (0)