Skip to content

Commit 8982ff3

Browse files
committed
get_first
1 parent eb7aec5 commit 8982ff3

File tree

2 files changed

+3
-4
lines changed

2 files changed

+3
-4
lines changed

Cargo.toml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -177,7 +177,6 @@ forget_non_drop = "allow"
177177
format_collect = "allow"
178178
filter_map_bool_then = "allow"
179179
from_str_radix_10 = "allow"
180-
get_first = "allow"
181180
if_same_then_else = "allow"
182181
large_enum_variant = "allow"
183182
match_like_matches_macro = "allow"

crates/hir/src/semantics/source_to_def.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -142,7 +142,7 @@ impl SourceToDefCtx<'_, '_> {
142142
Some(parent_declaration) => self.module_to_def(parent_declaration),
143143
None => {
144144
let file_id = src.file_id.original_file(self.db.upcast());
145-
self.file_to_def(file_id).get(0).copied()
145+
self.file_to_def(file_id).first().copied()
146146
}
147147
}?;
148148

@@ -155,7 +155,7 @@ impl SourceToDefCtx<'_, '_> {
155155
pub(super) fn source_file_to_def(&self, src: InFile<ast::SourceFile>) -> Option<ModuleId> {
156156
let _p = profile::span("source_file_to_def");
157157
let file_id = src.file_id.original_file(self.db.upcast());
158-
self.file_to_def(file_id).get(0).copied()
158+
self.file_to_def(file_id).first().copied()
159159
}
160160

161161
pub(super) fn trait_to_def(&mut self, src: InFile<ast::Trait>) -> Option<TraitId> {
@@ -370,7 +370,7 @@ impl SourceToDefCtx<'_, '_> {
370370
}
371371
}
372372

373-
let def = self.file_to_def(src.file_id.original_file(self.db.upcast())).get(0).copied()?;
373+
let def = self.file_to_def(src.file_id.original_file(self.db.upcast())).first().copied()?;
374374
Some(def.into())
375375
}
376376

0 commit comments

Comments
 (0)