suggestions by Clippy

This commit is contained in:
2023-09-16 14:21:57 +02:00
parent ef3b0f2285
commit a72f2645d0
2 changed files with 5 additions and 1 deletions

View File

@@ -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)
}

View File

@@ -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;