aboutsummaryrefslogtreecommitdiff
path: root/pulse/src/config.rs
diff options
context:
space:
mode:
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 {