suggestions by Clippy
This commit is contained in:
@@ -10,15 +10,19 @@ pub trait UnitsConversion {
|
||||
}
|
||||
|
||||
impl UnitsConversion for f64 {
|
||||
#[allow(non_snake_case)]
|
||||
fn dBm_to_W(&self) -> f64 {
|
||||
10.0_f64.powf((self - 30.0) / 10.0)
|
||||
}
|
||||
#[allow(non_snake_case)]
|
||||
fn W_to_dBm(&self) -> f64 {
|
||||
30.0 + 10.0 * f64::log10(*self)
|
||||
}
|
||||
#[allow(non_snake_case)]
|
||||
fn from_dB(&self) -> f64 {
|
||||
10.0_f64.powf((*self) / 10.0)
|
||||
}
|
||||
#[allow(non_snake_case)]
|
||||
fn to_dB(&self) -> f64 {
|
||||
10.0 * f64::log10(*self)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user