Skip to content

Commit 541ddb2

Browse files
committed
Don't clone depends
1 parent dd9d846 commit 541ddb2

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

crates/ark/src/lsp/diagnostics.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -845,7 +845,9 @@ fn handle_package_attach_call(node: Node, context: &mut DiagnosticContext) -> an
845845
let package = insert_package_exports(&package_name, attach_pos, context)?;
846846

847847
// Also attach packages from `Depends` field
848-
let mut attach_dependencies = package.description.depends.clone();
848+
for package_name in package.description.depends.iter() {
849+
insert_package_exports(&package_name, attach_pos, context)?;
850+
}
849851

850852
// Special handling for the tidyverse and tidymodels packages. Hard-coded
851853
// for now but in the future, this should probably be expressed as a
@@ -888,9 +890,7 @@ fn handle_package_attach_call(node: Node, context: &mut DiagnosticContext) -> an
888890
},
889891
_ => vec![],
890892
};
891-
attach_dependencies.extend(attach_field.into_iter().map(String::from));
892-
893-
for package_name in attach_dependencies {
893+
for package_name in attach_field {
894894
insert_package_exports(&package_name, attach_pos, context)?;
895895
}
896896

0 commit comments

Comments
 (0)