Skip to content

Commit c771f99

Browse files
Merge commit '40500c9d2139699b14a34d80873c718ba52a8a8e'
1 parent 3ecdaf7 commit c771f99

File tree

1 file changed

+6
-1
lines changed
  • codegen-core/src/main/kotlin/software/amazon/smithy/rust/codegen/core/smithy/generators

1 file changed

+6
-1
lines changed

codegen-core/src/main/kotlin/software/amazon/smithy/rust/codegen/core/smithy/generators/CargoTomlGenerator.kt

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,11 @@ class CargoTomlGenerator(
8181
"features" to cargoFeatures.toMap(),
8282
).deepMergeWith(manifestCustomizations)
8383

84-
writer.writeWithNoFormatting(TomlWriter().write(cargoToml))
84+
// NOTE: without this it will produce ["target.'cfg(aws_sdk_unstable)'.dependencies"]
85+
// In JSON, this is an equivalent of: {"target.'cfg(aws_sdk_unstable)'.dependencies" : ...}
86+
// To make it work, it has to be: {"target": {'cfg(aws_sdk_unstable)': {"dependencies": ...}}}
87+
// This piece of code fixes it.
88+
var tomlString = TomlWriter().write(cargoToml).replace("\"target.'cfg(aws_sdk_unstable)'.dependencies\"", "target.'cfg(aws_sdk_unstable)'.dependencies")
89+
writer.writeWithNoFormatting(tomlString)
8590
}
8691
}

0 commit comments

Comments
 (0)