Skip to content

Commit 91cb4c8

Browse files
committed
Apply feedback
1 parent 962c66c commit 91cb4c8

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

packages/renderers-rust/README.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,7 @@ const traitOptions = {
109109
Now, if at any point, we encounter a `fruits::Apple` or `fruits::Banana` trait to be rendered (either as default traits or as overridden traits), they will be rendered under the `fruits` feature flag. For instance:
110110

111111
```rust
112-
#[cfg(feature = "fruits", derive(fruits::Apple, fruits::Banana))]
112+
#[cfg_attr(feature = "fruits", derive(fruits::Apple, fruits::Banana))]
113113
```
114114

115115
By default, the `featureFlags` option is set to the following:
@@ -120,6 +120,8 @@ const traitOptions = {
120120
};
121121
```
122122

123+
Note that for feature flags to be effective, they must be added to the `Cargo.toml` file of the generated Rust client.
124+
123125
### Using the Fully Qualified Name
124126

125127
By default, all traits are imported using the provided Fully Qualified Name which means their short name will be used within the `derive` attributes.

packages/renderers-rust/src/utils/traitOptions.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ export type TraitOptions = {
1313
/**
1414
* The mapping of feature flags to traits.
1515
* For each entry, the traits will be rendered within a
16-
* `#[cfg(feature = "feature_name", derive(Traits))]` attribute.
16+
* `#[cfg_attr(feature = "feature_name", derive(Traits))]` attribute.
1717
*/
1818
featureFlags?: Record<string, string[]>;
1919
/** The complete trait overrides of specific types. */

0 commit comments

Comments
 (0)