Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(toml): Warn on unused workspace.dependencies keys on virtual workspaces #13664

Merged
merged 12 commits into from
Mar 28, 2024
Merged
3 changes: 1 addition & 2 deletions src/cargo/util/toml/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -926,15 +926,14 @@ pub fn to_real_manifest(
.map(|mw| field_inherit_with(mw, "include", || inherit()?.include()))
.transpose()?
.unwrap_or_default();
let empty_features = BTreeMap::new();

let summary = Summary::new(
pkgid,
deps,
&original_toml
.features
.as_ref()
.unwrap_or(&empty_features)
.unwrap_or(&Default::default())
Copy link
Member

Choose a reason for hiding this comment

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

nit

Suggested change
.unwrap_or(&Default::default())
.unwrap_or_default()

Copy link
Contributor Author

Choose a reason for hiding this comment

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

There is no impl Default for &T in this case

.iter()
.map(|(k, v)| {
(
Expand Down