Skip to content

Commit

Permalink
rustfmt pass and fix clippy on CI
Browse files Browse the repository at this point in the history
  • Loading branch information
azerupi committed Jun 10, 2021
1 parent 1aca3b3 commit 3bdd66f
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 13 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ jobs:
use-cross: true
command: clippy
# dummy feature to satisfy build.rs
args: --features stm32l0x1 -- -D warnings
args: --features mcu-STM32L083VZTx -- -D warnings
package:
name: Cargo package
runs-on: ubuntu-latest
Expand Down
25 changes: 15 additions & 10 deletions build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -33,10 +33,11 @@ fn main() {
(64, cfg!(feature = "flash-64")),
(128, cfg!(feature = "flash-128")),
(192, cfg!(feature = "flash-192")),
].iter()
.filter(|(_, f)| *f)
.map(|(f, _)| *f)
.collect();
]
.iter()
.filter(|(_, f)| *f)
.map(|(f, _)| *f)
.collect();

if flash_features.len() != 1 {
panic!("\n\nMust select exactly one flash size for linker script generation!\n\
Expand All @@ -50,10 +51,11 @@ fn main() {
(2, cfg!(feature = "ram-2")),
(8, cfg!(feature = "ram-8")),
(20, cfg!(feature = "ram-20")),
].iter()
.filter(|(_, f)| *f)
.map(|(f, _)| *f)
.collect();
]
.iter()
.filter(|(_, f)| *f)
.map(|(f, _)| *f)
.collect();

if ram_features.len() != 1 {
panic!("\n\nMust select exactly one ram size for linker script generation!\n\
Expand All @@ -63,11 +65,14 @@ fn main() {

let ram_size = ram_features[0];

let linker = format!(r#"MEMORY
let linker = format!(
r#"MEMORY
{{
FLASH : ORIGIN = 0x08000000, LENGTH = {}K
RAM : ORIGIN = 0x20000000, LENGTH = {}K
}}"#, flash_size, ram_size);
}}"#,
flash_size, ram_size
);

File::create(out.join("memory.x"))
.unwrap()
Expand Down
2 changes: 1 addition & 1 deletion src/delay.rs
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ impl Delay {
let freq = clocks.sys_clk().0;
assert!(freq > 1_000_000_u32);
let ticks_per_us = freq / 1_000_000_u32;
Delay { syst, ticks_per_us }
Delay { ticks_per_us, syst }
}
pub fn delay<T>(&mut self, delay: T)
where
Expand Down
2 changes: 1 addition & 1 deletion src/encoder.rs
Original file line number Diff line number Diff line change
Expand Up @@ -212,9 +212,9 @@ macro_rules! encoders {
};

Status {
direction,
did_overflow,
count,
direction,
}
}

Expand Down

0 comments on commit 3bdd66f

Please sign in to comment.