fix(add): Reduce the chance of breaking the user's formatting

This commit is contained in:
Ed Page 2023-05-26 16:29:46 -05:00
parent b903527f28
commit 6d8f35f729
2 changed files with 12 additions and 4 deletions

View file

@ -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 {

View file

@ -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 = []