summaryrefslogtreecommitdiffstats
path: root/src/utils.rs
diff options
context:
space:
mode:
authorMinijackson <minijackson@riseup.net>2021-05-20 20:18:33 +0200
committerMinijackson <minijackson@riseup.net>2021-05-20 20:18:33 +0200
commitcc67030828bf31728ddc5c7064bf0a88e0bbb88a (patch)
tree2ce1ebd14fbae27bd9257db85f1b0afc3298924b /src/utils.rs
parent557074fb6dadf89ddbfce11d67fe8cac0f9eed80 (diff)
downloadset_eq-cc67030828bf31728ddc5c7064bf0a88e0bbb88a.tar.gz
set_eq-cc67030828bf31728ddc5c7064bf0a88e0bbb88a.zip
update deps and nix, remove pa_eq as module is deprecated
Diffstat (limited to 'src/utils.rs')
-rw-r--r--src/utils.rs31
1 files changed, 0 insertions, 31 deletions
diff --git a/src/utils.rs b/src/utils.rs
index 2e585b0..4596b3f 100644
--- a/src/utils.rs
+++ b/src/utils.rs
@@ -67,34 +67,3 @@ where
67 message: format!("{}", error), 67 message: format!("{}", error),
68 } 68 }
69} 69}
70
71pub fn decibel_to_ratio(decibel: f64) -> f64 {
72 10f64.powf(decibel / 10f64).sqrt()
73}
74
75/*
76fn introspect(conn: &dbus::ConnPath<&Connection>) {
77 let mut thing = conn
78 .method_call_with_args(
79 &"org.freedesktop.DBus.Introspectable".into(),
80 &"Introspect".into(),
81 |_| {},
82 ).unwrap();
83 thing.as_result().unwrap();
84
85 println!("{}", thing.iter_init().read::<String>().unwrap());
86}
87*/
88
89#[cfg(test)]
90mod tests {
91
92 #[test]
93 fn decibel_to_ratio() {
94 assert_eq!(super::decibel_to_ratio(0f64), 1f64);
95 assert_eq!(super::decibel_to_ratio(20f64), 10f64);
96 assert_eq!(super::decibel_to_ratio(40f64), 100f64);
97 assert_eq!(super::decibel_to_ratio(60f64), 1000f64);
98 }
99
100}