Code formatting
- Readability - `clippy`
This commit is contained in:
parent
4d9a7c0527
commit
32a94af1ee
@ -9,24 +9,31 @@ pub struct Main {
|
|||||||
/// Temperature in requested units (Kelvin, Celsius, or Fahrenheit)
|
/// Temperature in requested units (Kelvin, Celsius, or Fahrenheit)
|
||||||
#[serde(default)]
|
#[serde(default)]
|
||||||
pub temp: Option<f32>,
|
pub temp: Option<f32>,
|
||||||
|
|
||||||
/// "Feels like" temperature, accounting for human perception of weather
|
/// "Feels like" temperature, accounting for human perception of weather
|
||||||
#[serde(default)]
|
#[serde(default)]
|
||||||
pub feels_like: Option<f32>,
|
pub feels_like: Option<f32>,
|
||||||
|
|
||||||
/// Minimum observed temperature (within large urban areas)
|
/// Minimum observed temperature (within large urban areas)
|
||||||
#[serde(default)]
|
#[serde(default)]
|
||||||
pub temp_min: Option<f32>,
|
pub temp_min: Option<f32>,
|
||||||
|
|
||||||
/// Maximum observed temperature (within large urban areas)
|
/// Maximum observed temperature (within large urban areas)
|
||||||
#[serde(default)]
|
#[serde(default)]
|
||||||
pub temp_max: Option<f32>,
|
pub temp_max: Option<f32>,
|
||||||
|
|
||||||
/// Atmospheric pressure at sea level (hPa)
|
/// Atmospheric pressure at sea level (hPa)
|
||||||
#[serde(default)]
|
#[serde(default)]
|
||||||
pub pressure: Option<u32>,
|
pub pressure: Option<u32>,
|
||||||
|
|
||||||
/// Humidity percentage (0-100)
|
/// Humidity percentage (0-100)
|
||||||
#[serde(default)]
|
#[serde(default)]
|
||||||
pub humidity: Option<u8>,
|
pub humidity: Option<u8>,
|
||||||
|
|
||||||
/// Atmospheric pressure at sea level (hPa)
|
/// Atmospheric pressure at sea level (hPa)
|
||||||
#[serde(default)]
|
#[serde(default)]
|
||||||
pub sea_level: Option<u32>,
|
pub sea_level: Option<u32>,
|
||||||
|
|
||||||
/// Atmospheric pressure at ground level (hPa)
|
/// Atmospheric pressure at ground level (hPa)
|
||||||
#[serde(default)]
|
#[serde(default)]
|
||||||
pub grnd_level: Option<u32>,
|
pub grnd_level: Option<u32>,
|
||||||
|
@ -20,4 +20,4 @@
|
|||||||
pub mod coord;
|
pub mod coord;
|
||||||
pub mod main;
|
pub mod main;
|
||||||
pub mod weather;
|
pub mod weather;
|
||||||
pub mod wind;
|
pub mod wind;
|
||||||
|
@ -15,7 +15,7 @@ pub struct Wind {
|
|||||||
/// - 270°: West
|
/// - 270°: West
|
||||||
#[serde(default)]
|
#[serde(default)]
|
||||||
pub deg: Option<u16>,
|
pub deg: Option<u16>,
|
||||||
|
|
||||||
/// Wind gust speed in chosen units
|
/// Wind gust speed in chosen units
|
||||||
#[serde(default)]
|
#[serde(default)]
|
||||||
pub gust: Option<f32>,
|
pub gust: Option<f32>,
|
||||||
@ -44,4 +44,4 @@ impl Wind {
|
|||||||
let index = (((u32::from(deg) * 16 + 11) / 22) % 16) as usize;
|
let index = (((u32::from(deg) * 16 + 11) / 22) % 16) as usize;
|
||||||
Some(directions[index])
|
Some(directions[index])
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user