Skip to content

Commit 1cb5542

Browse files
committed
Cargo fmt
1 parent ba551c5 commit 1cb5542

File tree

3 files changed

+22
-19
lines changed

3 files changed

+22
-19
lines changed

Cargo.toml

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -39,13 +39,11 @@ overflow-checks = true
3939

4040
# cargo build/run --release
4141
[profile.release]
42-
codegen-units = 1
4342
debug = 2
44-
debug-assertions = false
45-
incremental = false
46-
lto = 'fat'
47-
opt-level = 3
48-
overflow-checks = false
43+
incremental = true
44+
lto = 'thin'
45+
opt-level = 0
46+
split-debuginfo = "packed"
4947

5048
# do not optimize proc-macro crates = faster builds from scratch
5149
[profile.dev.build-override]

inputmodule-control/Cargo.toml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,10 @@ clap = { version = "4.0", features = ["derive"] }
88
serialport = "4.2.0"
99

1010
# For ledmatrix
11-
image = "0.24.5"
11+
image = { version = "0.24.5", default-features = false, features = [
12+
"ico",
13+
"gif",
14+
] }
1215
rand = "0.8.5"
1316
chrono = "0.4.23"
1417

inputmodule-control/src/inputmodule.rs

Lines changed: 14 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -640,7 +640,6 @@ fn random_eq_cmd(serialdevs: &Vec<String>) {
640640
}
641641
}
642642

643-
644643
// The data-type for storing analyzer results
645644
#[derive(Debug, Clone)]
646645
pub struct AnalyzerResult {
@@ -694,23 +693,26 @@ fn input_eq_cmd(serialdevs: &Vec<String>) {
694693
// This is just a primitive example, your vis core belongs here
695694

696695
frame.info(|info| {
697-
698696
let sampled_volume = info.volume;
699-
let limited_volume = if sampled_volume < 34.0 { sampled_volume } else { 34.0 };
697+
let limited_volume = if sampled_volume < 34.0 {
698+
sampled_volume
699+
} else {
700+
34.0
701+
};
700702

701703
let display_max_widths = [10.0, 14.0, 20.0, 28.0, 34.0, 28.0, 20.0, 14.0, 10.0];
702704

703-
let volumes_to_display = display_max_widths.iter().map(|x| {
704-
let computed_width = (limited_volume / 34.0) * x;
705-
let next_lowest_odd = computed_width - (computed_width % 2.0) - 1.0;
706-
next_lowest_odd as u8
707-
}).collect::<Vec<_>>();
705+
let volumes_to_display = display_max_widths
706+
.iter()
707+
.map(|x| {
708+
let computed_width = (limited_volume / 34.0) * x;
709+
let next_lowest_odd = computed_width - (computed_width % 2.0) - 1.0;
710+
next_lowest_odd as u8
711+
})
712+
.collect::<Vec<_>>();
708713

709714
for serialdev in serialdevs {
710-
eq_cmd(
711-
serialdev,
712-
volumes_to_display.as_slice()
713-
)
715+
eq_cmd(serialdev, volumes_to_display.as_slice())
714716
}
715717
});
716718
thread::sleep(Duration::from_millis(30));

0 commit comments

Comments
 (0)