We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 8657668 commit 180c3c8Copy full SHA for 180c3c8
src/cargo/util/toml_mut/manifest.rs
@@ -516,7 +516,9 @@ fn fix_feature_activations(
516
} = parsed_value
517
{
518
if dep_name == dep_key && weak {
519
- *value = format!("{dep_name}/{dep_feature}").into();
+ let mut new_value = toml_edit::Value::from(format!("{dep_name}/{dep_feature}"));
520
+ *new_value.decor_mut() = value.decor().clone();
521
+ *value = new_value;
522
}
523
524
tests/testsuite/cargo_add/preserve_features_table/out/Cargo.toml
@@ -14,7 +14,8 @@ default = [
14
"b",
15
"c",
16
]
17
-a = ["your-face/nose", # but not the mouth and nose
+a = [
18
+ "your-face/nose", # but not the mouth and nose
19
20
b = []
21
c = []
0 commit comments