diff options
| author | Johann Hemmann <johann.hemmann@code.berlin> | 2024-01-19 14:35:36 +0100 |
|---|---|---|
| committer | Johann Hemmann <johann.hemmann@code.berlin> | 2024-01-19 17:31:01 +0100 |
| commit | 8982ff3bba2635f8e4d973b488313c430323c5d8 (patch) | |
| tree | 761ce9ab50a5a32f04508ecc50d0f36a8e3089ee | |
| parent | eb7aec5a8e064c5b0aec33ac17e070d3824c0467 (diff) | |
| download | rust-8982ff3bba2635f8e4d973b488313c430323c5d8.tar.gz rust-8982ff3bba2635f8e4d973b488313c430323c5d8.zip | |
get_first
| -rw-r--r-- | Cargo.toml | 1 | ||||
| -rw-r--r-- | crates/hir/src/semantics/source_to_def.rs | 6 |
2 files changed, 3 insertions, 4 deletions
diff --git a/Cargo.toml b/Cargo.toml index c9ad876176e..a3c2dc4eb74 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -177,7 +177,6 @@ forget_non_drop = "allow" format_collect = "allow" filter_map_bool_then = "allow" from_str_radix_10 = "allow" -get_first = "allow" if_same_then_else = "allow" large_enum_variant = "allow" match_like_matches_macro = "allow" diff --git a/crates/hir/src/semantics/source_to_def.rs b/crates/hir/src/semantics/source_to_def.rs index cb04f98911e..e581c84b79f 100644 --- a/crates/hir/src/semantics/source_to_def.rs +++ b/crates/hir/src/semantics/source_to_def.rs @@ -142,7 +142,7 @@ impl SourceToDefCtx<'_, '_> { Some(parent_declaration) => self.module_to_def(parent_declaration), None => { let file_id = src.file_id.original_file(self.db.upcast()); - self.file_to_def(file_id).get(0).copied() + self.file_to_def(file_id).first().copied() } }?; @@ -155,7 +155,7 @@ impl SourceToDefCtx<'_, '_> { pub(super) fn source_file_to_def(&self, src: InFile<ast::SourceFile>) -> Option<ModuleId> { let _p = profile::span("source_file_to_def"); let file_id = src.file_id.original_file(self.db.upcast()); - self.file_to_def(file_id).get(0).copied() + self.file_to_def(file_id).first().copied() } pub(super) fn trait_to_def(&mut self, src: InFile<ast::Trait>) -> Option<TraitId> { @@ -370,7 +370,7 @@ impl SourceToDefCtx<'_, '_> { } } - let def = self.file_to_def(src.file_id.original_file(self.db.upcast())).get(0).copied()?; + let def = self.file_to_def(src.file_id.original_file(self.db.upcast())).first().copied()?; Some(def.into()) } |
