Skip to content

Commit

Permalink
fix clippy workflow node 12 warning
Browse files Browse the repository at this point in the history
  • Loading branch information
grtwje committed Mar 18, 2023
1 parent 7bec122 commit c07ca02
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 22 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,6 @@ jobs:
- name: Fmt
run: cargo fmt --all -- --check
- name: Lint
uses: actions-rs/clippy-check@v1
run: cargo clippy -- -D warnings
with:
token: ${{ secrets.GITHUB_TOKEN }}
9 changes: 2 additions & 7 deletions src/meter_type.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,10 @@
use serde::Deserialize;

/// Meters supported by SolarEdge.
#[derive(Clone, Deserialize, Debug, PartialEq)]
#[derive(Clone, Deserialize, Debug, PartialEq, Default)]
pub enum MeterType {
/// Solar energy produced.
#[default]
Production,

/// Total energy consumed (solar + grid)
Expand Down Expand Up @@ -33,12 +34,6 @@ impl std::fmt::Display for MeterType {
}
}

impl Default for MeterType {
fn default() -> MeterType {
MeterType::Production
}
}

#[cfg(test)]
mod tests {
use super::*;
Expand Down
9 changes: 2 additions & 7 deletions src/site_inverter_technical_data.rs
Original file line number Diff line number Diff line change
Expand Up @@ -99,10 +99,11 @@ pub struct LxData {
}

/// Inverter operating mode
#[derive(Clone, Deserialize, Debug, PartialEq)]
#[derive(Clone, Deserialize, Debug, PartialEq, Default)]
#[serde(rename_all = "SCREAMING_SNAKE_CASE")]
pub enum InverterMode {
/// Off
#[default]
Off,

/// Night mode
Expand Down Expand Up @@ -179,12 +180,6 @@ impl std::fmt::Display for InverterMode {
}
}

impl Default for InverterMode {
fn default() -> InverterMode {
InverterMode::Off
}
}

impl Req {
/// Create an power details request message that can be sent to SolarEdge.
///
Expand Down
9 changes: 2 additions & 7 deletions src/time_unit.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ use serde::Deserialize;

/// Time units specified in SolarEdge server monitoring API requests and responses.
/// Specifies the aggregation granularity of the data.
#[derive(Clone, Deserialize, Debug, PartialEq)]
#[derive(Clone, Deserialize, Debug, PartialEq, Default)]
#[serde(rename_all = "SCREAMING_SNAKE_CASE")]
pub enum TimeUnit {
/// 15 minutes
Expand All @@ -14,6 +14,7 @@ pub enum TimeUnit {
Hour,

/// 24 hours
#[default]
Day,

/// 7 days
Expand All @@ -39,12 +40,6 @@ impl std::fmt::Display for TimeUnit {
}
}

impl Default for TimeUnit {
fn default() -> TimeUnit {
TimeUnit::Day
}
}

#[cfg(test)]
mod tests {
use super::*;
Expand Down

0 comments on commit c07ca02

Please sign in to comment.