File tree 3 files changed +13
-0
lines changed 3 files changed +13
-0
lines changed Original file line number Diff line number Diff line change @@ -26,6 +26,8 @@ and this project adheres to [Semantic Versioning](http://semver.org/).
26
26
27
27
- Ignore default enumeratedValues.
28
28
29
+ - Bring ` generic ` module into scope in ` lib.rs ` when using ` -g ` option.
30
+
29
31
### Changed
30
32
31
33
- [ breaking-change] remove ` Variant<U, ENUM_A> ` , use ` Option<ENUM_A> ` instead
Original file line number Diff line number Diff line change @@ -146,6 +146,13 @@ pub fn render(
146
146
let generic_file = std:: str:: from_utf8 ( include_bytes ! ( "generic.rs" ) ) ?;
147
147
if generic_mod {
148
148
writeln ! ( File :: create( "generic.rs" ) ?, "{}" , generic_file) ?;
149
+
150
+ out. extend ( quote ! {
151
+ #[ allow( unused_imports) ]
152
+ use generic:: * ;
153
+ ///Common register and bit access and modify traits
154
+ pub mod generic;
155
+ } ) ;
149
156
} else {
150
157
let tokens = syn:: parse_file ( generic_file) ?. into_token_stream ( ) ;
151
158
Original file line number Diff line number Diff line change 26
26
//!
27
27
//! If the `--target` flag is omitted `svd2rust` assumes the target is the Cortex-M architecture.
28
28
//!
29
+ //! If using the `--generic_mod` option, the emitted `generic.rs` needs to be moved to `src`, and
30
+ //! [`form`](https://github.com/djmcgill/form) commit fcb397a or newer is required for splitting
31
+ //! the emitted `lib.rs`.
32
+ //!
29
33
//! ## target = cortex-m
30
34
//!
31
35
//! When targeting the Cortex-M architecture, `svd2rust` will generate three files in the current
You can’t perform that action at this time.
0 commit comments