Skip to content

Commit 1c24991

Browse files
update
1 parent c49b208 commit 1c24991

File tree

1 file changed

+6
-18
lines changed
  • codegen-client/src/main/kotlin/software/amazon/smithy/rust/codegen/client/smithy/customize

1 file changed

+6
-18
lines changed

codegen-client/src/main/kotlin/software/amazon/smithy/rust/codegen/client/smithy/customize/SerdeDecorator.kt

Lines changed: 6 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -24,11 +24,11 @@ class SerdeDecorator : ClientCodegenDecorator {
2424
override val order: Byte = -1
2525

2626
override fun extras(codegenContext: ClientCodegenContext, rustCrate: RustCrate) {
27-
fun _feature(featureName: String, crateName: String): Feature {
28-
return Feature(featureName, false, listOf("$crateName/$featureName"))
27+
fun feature(featureName: String): Feature {
28+
return Feature(featureName, false, listOf("aws-smithy-types/$featureName"))
2929
}
30-
rustCrate.mergeFeature(_feature("serde-serialize", "aws-smithy-types"))
31-
rustCrate.mergeFeature(_feature("serde-deserialize", "aws-smithy-types"))
30+
rustCrate.mergeFeature(feature("serde-serialize"))
31+
rustCrate.mergeFeature(feature("serde-deserialize"))
3232
}
3333

3434
override fun libRsCustomizations(
@@ -39,26 +39,14 @@ class SerdeDecorator : ClientCodegenDecorator {
3939

4040
class SerdeDocGenerator(private val codegenContext: ClientCodegenContext) : LibRsCustomization() {
4141
override fun section(section: LibRsSection): Writable {
42-
if (section is LibRsSection.ModuleDoc && section.subsection is ModuleDocSection.ServiceDocs) {
42+
if (section is LibRsSection.ModuleDoc) {
4343
return writable {
4444
"""
45-
# How to enable `Serialize` and `Deserialize`
45+
### How to enable `Serialize` and `Deserialize`
4646
This data type implements `Serialize` and `Deserialize` traits from the popular serde crate,
4747
but those traits are behind feature gate.
4848
4949
As they increase it's compile time dramatically, you should not turn them on unless it's necessary.
50-
Furthermore, implementation of serde is still unstable, and implementation may change anytime in future.
51-
52-
To enable traits, you must pass `aws_sdk_unstable` to RUSTFLAGS and enable `serde-serialize` or `serde-deserialize` feature.
53-
54-
e.g.
55-
```bash
56-
export RUSTFLAGS="--cfg aws_sdk_unstable"
57-
cargo build --features serde-serialize serde-deserialize
58-
```
59-
60-
If you enable `serde-serialize` and/or `serde-deserialize` without `RUSTFLAGS="--cfg aws_sdk_unstable"`,
61-
compilation will fail with warning.
6250
""".trimIndent()
6351
}
6452
} else {

0 commit comments

Comments
 (0)