mirror of
https://github.com/rust-lang/cargo.git
synced 2025-10-01 11:30:39 +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() {
|
for idx in remove_list.iter().rev() {
|
||||||
feature_values.remove(*idx);
|
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 {
|
if status == DependencyStatus::Required {
|
||||||
for value in feature_values.iter_mut() {
|
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 {
|
pub fn str_or_1_len_table(item: &toml_edit::Item) -> bool {
|
||||||
|
@ -9,7 +9,12 @@ edition = "2021"
|
|||||||
your-face = { version = "99999.0.0" }
|
your-face = { version = "99999.0.0" }
|
||||||
|
|
||||||
[features]
|
[features]
|
||||||
default = ["a", "b", "c"]
|
default = [
|
||||||
a = ["your-face/nose"]
|
"a",
|
||||||
|
"b",
|
||||||
|
"c",
|
||||||
|
]
|
||||||
|
a = ["your-face/nose", # but not the mouth and nose
|
||||||
|
]
|
||||||
b = []
|
b = []
|
||||||
c = []
|
c = []
|
||||||
|
Loading…
x
Reference in New Issue
Block a user