aboutsummaryrefslogtreecommitdiff
path: root/pulse/src/config.rs
diff options
context:
space:
mode:
authorAndreas Grois <andi@grois.info>2021-11-29 22:38:44 +0100
committerAndreas Grois <andi@grois.info>2021-11-29 22:38:44 +0100
commit6277f4351fd68f1cdd434818eac7b0d18eac3c76 (patch)
treea9d221d635b9e524569aca0947388c1b6fe4c930 /pulse/src/config.rs
parent8e186854556838353091b87f7a2be3ac5d400523 (diff)
Run clippy and fix all lints.
Diffstat (limited to 'pulse/src/config.rs')
-rw-r--r--pulse/src/config.rs12
1 files changed, 5 insertions, 7 deletions
diff --git a/pulse/src/config.rs b/pulse/src/config.rs
index f95bd46..0be7367 100644
--- a/pulse/src/config.rs
+++ b/pulse/src/config.rs
@@ -128,7 +128,7 @@ impl Default for PulseVolumeConfig {
impl SwayStatusModuleInstance for PulseVolumeConfig {
fn make_runnable<'p>(&'p self,to_main : Box<dyn MsgModuleToMain + 'p>) -> (Box<dyn SwayStatusModuleRunnable + 'p>, Box<dyn MsgMainToModule + 'p>) {
- let (runnable, sender_for_main) = crate::runnable::PulseVolumeRunnable::new(&self, to_main);
+ let (runnable, sender_for_main) = crate::runnable::PulseVolumeRunnable::new(self, to_main);
(Box::new(runnable), Box::new(sender_for_main))
}
}
@@ -162,13 +162,11 @@ impl<KeyTypeMetadata : VolumeKeyBackingTypeMetadata> FormatableVolume<KeyTypeMet
if let Some((_,msg)) = bin_symbol_map.range(..=value_to_match).next_back() {
Ok(format!("{}{}",label,msg))
}
+ else if let Some((_,msg)) = bin_symbol_map.iter().next() {
+ Ok(format!("{}{}",label,msg))
+ }
else {
- if let Some((_,msg)) = bin_symbol_map.iter().next() {
- Ok(format!("{}{}",label,msg))
- }
- else {
- Err(FormattingError::EmptyMap{numeric_fallback : Self::format_float_numeric(float, label, 0) })
- }
+ Err(FormattingError::EmptyMap{numeric_fallback : Self::format_float_numeric(float, label, 0) })
}
}
fn format_float_numeric(float : f32, label : &str, digits : u8) -> String {