@@ -29,28 +29,31 @@ pub fn render(d: &Device, config: &Config, device_x: &mut String) -> Result<Toke
29
29
}
30
30
} ;
31
31
32
- let doc = format ! (
33
- "Peripheral access API for {0} microcontrollers \
34
- (generated using svd2rust v{1}{commit_info})\n \n \
35
- You can find an overview of the generated API [here].\n \n \
36
- API features to be included in the [next] svd2rust \
37
- release can be generated by cloning the svd2rust [repository], \
38
- checking out the above commit, and running `cargo doc --open`.\n \n \
39
- [here]: https://docs.rs/svd2rust/{1}/svd2rust/#peripheral-api\n \
40
- [next]: https://github.com/rust-embedded/svd2rust/blob/master/CHANGELOG.md#unreleased\n \
41
- [repository]: https://github.com/rust-embedded/svd2rust",
42
- d. name. to_uppercase( ) ,
43
- env!( "CARGO_PKG_VERSION" ) ,
44
- ) ;
45
-
46
32
if config. target == Target :: Msp430 {
47
33
out. extend ( quote ! {
48
34
#![ feature( abi_msp430_interrupt) ]
49
35
} ) ;
50
36
}
51
37
52
- out. extend ( quote ! { #![ doc = #doc] } ) ;
53
- if !config. make_mod {
38
+ if !config. skip_crate_attributes {
39
+ let doc = format ! (
40
+ "Peripheral access API for {0} microcontrollers \
41
+ (generated using svd2rust v{1}{commit_info})\n \n \
42
+ You can find an overview of the generated API [here].\n \n \
43
+ API features to be included in the [next] svd2rust \
44
+ release can be generated by cloning the svd2rust [repository], \
45
+ checking out the above commit, and running `cargo doc --open`.\n \n \
46
+ [here]: https://docs.rs/svd2rust/{1}/svd2rust/#peripheral-api\n \
47
+ [next]: https://github.com/rust-embedded/svd2rust/blob/master/CHANGELOG.md#unreleased\n \
48
+ [repository]: https://github.com/rust-embedded/svd2rust",
49
+ d. name. to_uppercase( ) ,
50
+ env!( "CARGO_PKG_VERSION" ) ,
51
+ ) ;
52
+
53
+ out. extend ( quote ! { #![ doc = #doc] } ) ;
54
+ }
55
+
56
+ if !config. make_mod && !config. skip_crate_attributes {
54
57
out. extend ( quote ! {
55
58
// Explicitly allow a few warnings that may be verbose
56
59
#![ allow( non_camel_case_types) ]
0 commit comments