Skip to content

Commit

Permalink
clippy
Browse files Browse the repository at this point in the history
  • Loading branch information
cbrit committed Jan 8, 2025
1 parent a35d3a7 commit 31a355a
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 22 deletions.
4 changes: 2 additions & 2 deletions src/cellars.rs
Original file line number Diff line number Diff line change
Expand Up @@ -296,11 +296,11 @@ pub fn log_governance_cellar_call(
// since a string prefixed with or without 0x is parsable, ensure the string comparison is valid
pub fn normalize_address(address: String) -> String {
let lowercase_address = address.to_lowercase();
return address
address
.to_lowercase()
.strip_prefix("0x")
.unwrap_or(&lowercase_address)
.to_string();
.to_string()
}

// validation logic
Expand Down
1 change: 1 addition & 0 deletions src/commands.rs
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ use std::{env, path::PathBuf};
pub const CONFIG_FILE: &str = "steward.toml";

/// Steward Subcommands
#[allow(non_local_definitions)]
#[derive(Command, Debug, Parser, Runnable)]
pub enum StewardCmd {
// #[clap(subcommand)]
Expand Down
22 changes: 2 additions & 20 deletions src/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -311,34 +311,16 @@ impl Default for SimulateSection {
}
}

#[derive(Clone, Debug, Deserialize, Serialize)]
#[derive(Clone, Debug, Default, Deserialize, Serialize)]
#[serde(default, deny_unknown_fields)]
pub struct JobsConfig {
pub update_strategist_platform_cut: Option<UpdateStrategistPlatformCutConfig>,
}

impl Default for JobsConfig {
fn default() -> Self {
Self {
update_strategist_platform_cut: None,
}
}
}

#[derive(Clone, Debug, Deserialize, Serialize)]
#[derive(Clone, Debug, Default, Deserialize, Serialize)]
#[serde(default, deny_unknown_fields)]
pub struct UpdateStrategistPlatformCutConfig {
pub height: u64,
pub cellars_v2_2: Vec<String>,
pub cellars_v2_5: Vec<String>,
}

impl Default for UpdateStrategistPlatformCutConfig {
fn default() -> Self {
Self {
height: 0,
cellars_v2_2: Vec::default(),
cellars_v2_5: Vec::default(),
}
}
}
1 change: 1 addition & 0 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
#![forbid(unsafe_code)]
#![warn(trivial_casts)]
#![allow(clippy::uninlined_format_args)]
#![allow(non_local_definitions)]

pub mod application;
pub mod cellars;
Expand Down

0 comments on commit 31a355a

Please sign in to comment.