File tree Expand file tree Collapse file tree 1 file changed +10
-2
lines changed Expand file tree Collapse file tree 1 file changed +10
-2
lines changed Original file line number Diff line number Diff line change @@ -149,8 +149,16 @@ pub fn codegen(config: Config<'_>, out: impl Write) -> Result<()> {
149
149
writeln ! ( & mut w, "use bitvec::prelude::*;" ) ?;
150
150
writeln ! ( & mut w, "use embedded_can::{{Id, StandardId, ExtendedId}};" ) ?;
151
151
152
- writeln ! ( w, r##"#[cfg(feature = "arb")]"## ) ?;
153
- writeln ! ( & mut w, "use arbitrary::{{Arbitrary, Unstructured}};" ) ?;
152
+ match config. impl_arbitrary {
153
+ FeatureConfig :: Always => {
154
+ writeln ! ( & mut w, "use arbitrary::{{Arbitrary, Unstructured}};" ) ?;
155
+ }
156
+ FeatureConfig :: Gated ( gate) => {
157
+ writeln ! ( w, r##"#[cfg(feature = "{gate}")]"## ) ?;
158
+ writeln ! ( & mut w, "use arbitrary::{{Arbitrary, Unstructured}};" ) ?;
159
+ }
160
+ FeatureConfig :: Never => ( ) ,
161
+ }
154
162
155
163
match config. impl_serde {
156
164
FeatureConfig :: Always => {
You can’t perform that action at this time.
0 commit comments