Skip to content

Commit c2a3676

Browse files
author
Jorge Aparicio
committed
fix clippy warnings
1 parent 3c65375 commit c2a3676

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

src/lib.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ pub fn gen_peripheral(p: &Peripheral, d: &Defaults) -> Vec<Tokens> {
5454
let p_name = Ident::new(p.name.to_pascal_case());
5555

5656
if let Some(description) = p.description.as_ref() {
57-
let comment = &format!("{}", respace(description))[..];
57+
let comment = &respace(description)[..];
5858
items.push(quote! {
5959
#[doc = #comment]
6060
});
@@ -350,7 +350,7 @@ impl U32Ext for u32 {
350350
match *self {
351351
1...8 => Ident::new("u8"),
352352
9...16 => Ident::new("u16"),
353-
16...32 => Ident::new("u32"),
353+
17...32 => Ident::new("u32"),
354354
_ => panic!("{}.to_ty()", *self),
355355
}
356356
}

src/main.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ fn main() {
2929
let d = svd::parse(xml);
3030
match matches.value_of("peripheral") {
3131
None => {
32-
for peripheral in d.peripherals.iter() {
32+
for peripheral in &d.peripherals {
3333
println!("const {}: usize = 0x{:08x};",
3434
peripheral.name,
3535
peripheral.base_address);

0 commit comments

Comments
 (0)