Skip to content

Commit

Permalink
fix clippy warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
rkusa committed Jun 22, 2021
1 parent d4b5a8f commit e1ae25b
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion crates/datis-core/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,7 @@ impl Datis {
pub fn pause(&mut self) -> Result<(), Error> {
log::debug!("Shutting down all stations");

let shutdown_signals = mem::replace(&mut self.shutdown_signals, Vec::new());
let shutdown_signals = mem::take(&mut self.shutdown_signals);
for signal in shutdown_signals {
let _ = signal.send(());
}
Expand Down
6 changes: 3 additions & 3 deletions crates/datis-core/src/weather.rs
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ impl WeatherInfo {
let fog_vis = self.get_fog_visibility(alt);
let vis = vec![clouds_vis, dust_vis, fog_vis]
.into_iter()
.filter_map(|e| e)
.flatten()
.min();
// Visibility below 50m is considered as ZERO
vis.map(|v| {
Expand Down Expand Up @@ -327,7 +327,7 @@ impl OldClouds {
}

impl CloudCoverage {
pub fn to_metar(&self) -> &str {
pub fn to_metar(self) -> &'static str {
match self {
CloudCoverage::Clear => "CLR",
CloudCoverage::Few => "FEW",
Expand All @@ -351,7 +351,7 @@ impl std::fmt::Display for CloudCoverage {
}

impl WeatherCondition {
pub fn to_metar(&self) -> &str {
pub fn to_metar(self) -> &'static str {
match self {
WeatherCondition::SlightRain => "-RA",
WeatherCondition::Rain => "RA",
Expand Down

0 comments on commit e1ae25b

Please sign in to comment.