mirror of
https://github.com/Zedfrigg/ironbar.git
synced 2025-07-02 03:01:04 +02:00
refactor: fix strict clippy warnings
This commit is contained in:
parent
3d308ab572
commit
c214f65ecb
3 changed files with 9 additions and 20 deletions
|
@ -60,7 +60,7 @@ impl CustomWidget for SliderWidget {
|
|||
|
||||
scale.connect_change_value(move |scale, _, val| {
|
||||
// GTK will send values outside min/max range
|
||||
let val = clamp(val, min, max);
|
||||
let val = val.clamp(min, max);
|
||||
|
||||
if val != prev_value.get() {
|
||||
try_send!(
|
||||
|
@ -106,14 +106,3 @@ impl CustomWidget for SliderWidget {
|
|||
scale
|
||||
}
|
||||
}
|
||||
|
||||
/// Ensures `num` is between `min` and `max` (inclusive).
|
||||
fn clamp(num: f64, min: f64, max: f64) -> f64 {
|
||||
if num < min {
|
||||
min
|
||||
} else if num > max {
|
||||
max
|
||||
} else {
|
||||
num
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue