Skip to content

Commit 4d67b67

Browse files
committed
Minor refactoring using .min and revert Cargo.toml change
1 parent 7b35c23 commit 4d67b67

File tree

3 files changed

+35
-22
lines changed

3 files changed

+35
-22
lines changed

Cargo.lock

Lines changed: 33 additions & 12 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

inputmodule-control/Cargo.toml

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

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

inputmodule-control/src/inputmodule.rs

Lines changed: 1 addition & 6 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 {
@@ -695,11 +694,7 @@ fn input_eq_cmd(serialdevs: &Vec<String>) {
695694

696695
frame.info(|info| {
697696
let sampled_volume = info.volume;
698-
let limited_volume = if sampled_volume < 34.0 {
699-
sampled_volume
700-
} else {
701-
34.0
702-
};
697+
let limited_volume = sampled_volume.min(34.0);
703698

704699
let display_max_widths = [10.0, 14.0, 20.0, 28.0, 34.0, 28.0, 20.0, 14.0, 10.0];
705700

0 commit comments

Comments
 (0)