mirror of
https://github.com/rust-lang/cargo
synced 2024-10-13 19:22:33 +00:00
fix(add): Reduce the chance of breaking the user's formatting
This commit is contained in:
parent
b903527f28
commit
6d8f35f729
|
@ -496,6 +496,11 @@ fn fix_feature_activations(
|
|||
for idx in remove_list.iter().rev() {
|
||||
feature_values.remove(*idx);
|
||||
}
|
||||
if !remove_list.is_empty() {
|
||||
// HACK: Instead of cleaning up the users formatting from having removed a feature, we just
|
||||
// re-format the whole feature list
|
||||
feature_values.fmt();
|
||||
}
|
||||
|
||||
if status == DependencyStatus::Required {
|
||||
for value in feature_values.iter_mut() {
|
||||
|
@ -516,8 +521,6 @@ fn fix_feature_activations(
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
feature_values.fmt();
|
||||
}
|
||||
|
||||
pub fn str_or_1_len_table(item: &toml_edit::Item) -> bool {
|
||||
|
|
|
@ -9,7 +9,12 @@ edition = "2021"
|
|||
your-face = { version = "99999.0.0" }
|
||||
|
||||
[features]
|
||||
default = ["a", "b", "c"]
|
||||
a = ["your-face/nose"]
|
||||
default = [
|
||||
"a",
|
||||
"b",
|
||||
"c",
|
||||
]
|
||||
a = ["your-face/nose", # but not the mouth and nose
|
||||
]
|
||||
b = []
|
||||
c = []
|
||||
|
|
Loading…
Reference in a new issue