Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions src/plugins/core/node.rs
Original file line number Diff line number Diff line change
Expand Up @@ -701,8 +701,9 @@ impl Backend for NodePlugin {
opts.insert("compile".to_string(), "true".to_string());
}

// Flavor affects which binary variant is downloaded (only if set)
if is_current_platform && let Some(flavor) = settings.node.flavor.clone() {
// Flavor affects which binary variant is downloaded
// Apply to all platforms to avoid splitting lockfile entries (#8390)
if let Some(flavor) = settings.node.flavor.clone() {
opts.insert("flavor".to_string(), flavor);
}
Comment on lines +706 to 708

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

While the current implementation is correct, it can be made slightly more efficient and idiomatic by borrowing instead of cloning the Option. This avoids cloning the Option itself and only clones the inner String when it's present.

Suggested change
if let Some(flavor) = settings.node.flavor.clone() {
opts.insert("flavor".to_string(), flavor);
}
if let Some(flavor) = &settings.node.flavor {
opts.insert("flavor".to_string(), flavor.clone());
}


Expand Down
5 changes: 3 additions & 2 deletions src/plugins/core/python.rs
Original file line number Diff line number Diff line change
Expand Up @@ -629,8 +629,9 @@ impl Backend for PythonPlugin {
opts.insert("compile".to_string(), "true".to_string());
}

// Only include precompiled options if not compiling and if set
if !compile && is_current_platform {
// Include precompiled options for all platforms to avoid splitting
// lockfile entries between host and non-host platforms (#8390)
if !compile {
if let Some(arch) = settings.python.precompiled_arch.clone() {
opts.insert("precompiled_arch".to_string(), arch);
}
Expand Down
Loading