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)
|
||||
}
|
||||
|
||||
@@ -95,7 +95,7 @@ pub async fn solve_for(device_id: MAC) -> Result<Point, ()> {
|
||||
fn trilat(a: &KnownDistance, b: &KnownDistance, c: &KnownDistance) -> Option<KnownDistance> {
|
||||
#![allow(non_snake_case)]
|
||||
|
||||
let points = vec![a.point, b.point, c.point];
|
||||
let points = [a.point, b.point, c.point];
|
||||
for &p in points.iter() {
|
||||
if !p.is_valid() {
|
||||
return None;
|
||||
|
||||
Reference in New Issue
Block a user