Skip to content

Commit d373b22

Browse files
committed
Remove extra clone
1 parent 770bfa9 commit d373b22

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

compiler-core/src/type_/environment.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -273,14 +273,14 @@ impl Environment<'_> {
273273
/// original names for them.
274274
pub fn resolve_deferred_type_variable_aliases(&mut self) {
275275
for (source_id, type_) in self.deferred_type_variable_aliases.drain(..) {
276-
if let Some(alias) = self.names.get_type_variable(source_id).cloned() {
276+
if let Some(alias) = self.names.get_type_variable(source_id) {
277277
let final_id = Self::resolve_type_var_id(&type_);
278278
if let Some(id) = final_id {
279279
// Only register if the target doesn't already have a name.
280280
// This avoids overwriting user-provided names (e.g. from
281281
// annotations) with names from instantiated type parameters.
282282
if self.names.get_type_variable(id).is_none() {
283-
self.names.type_variable_in_scope(id, alias);
283+
self.names.type_variable_in_scope(id, alias.clone());
284284
}
285285
}
286286
}

0 commit comments

Comments
 (0)