mirror of
https://github.com/Zedfrigg/ironbar.git
synced 2025-07-01 10:41:03 +02:00
refactor: fix casting based clippy warnings
This commit is contained in:
parent
bea442ed96
commit
e847a84c21
3 changed files with 4 additions and 4 deletions
|
@ -244,7 +244,7 @@ impl MusicClient for Client {
|
||||||
|
|
||||||
fn set_volume_percent(&self, vol: u8) -> Result<()> {
|
fn set_volume_percent(&self, vol: u8) -> Result<()> {
|
||||||
if let Some(player) = Self::get_player(self) {
|
if let Some(player) = Self::get_player(self) {
|
||||||
player.set_volume(vol as f64 / 100.0)?;
|
player.set_volume(f64::from(vol) / 100.0)?;
|
||||||
} else {
|
} else {
|
||||||
error!("Could not find player");
|
error!("Could not find player");
|
||||||
}
|
}
|
||||||
|
|
|
@ -274,9 +274,9 @@ impl ItemButton {
|
||||||
let (x, y) = ev.position();
|
let (x, y) = ev.position();
|
||||||
|
|
||||||
let close = match bar_position {
|
let close = match bar_position {
|
||||||
BarPosition::Top => y + THRESHOLD < alloc.height() as f64,
|
BarPosition::Top => y + THRESHOLD < f64::from(alloc.height()),
|
||||||
BarPosition::Bottom => y > THRESHOLD,
|
BarPosition::Bottom => y > THRESHOLD,
|
||||||
BarPosition::Left => x + THRESHOLD < alloc.width() as f64,
|
BarPosition::Left => x + THRESHOLD < f64::from(alloc.width()),
|
||||||
BarPosition::Right => x > THRESHOLD,
|
BarPosition::Right => x > THRESHOLD,
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -460,7 +460,7 @@ impl Module<Button> for MusicModule {
|
||||||
btn_next.set_sensitive(enable_next);
|
btn_next.set_sensitive(enable_next);
|
||||||
|
|
||||||
if let Some(volume) = update.status.volume_percent {
|
if let Some(volume) = update.status.volume_percent {
|
||||||
volume_slider.set_value(volume as f64);
|
volume_slider.set_value(f64::from(volume));
|
||||||
volume_box.show();
|
volume_box.show();
|
||||||
} else {
|
} else {
|
||||||
volume_box.hide();
|
volume_box.hide();
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue