Skip to content

Commit

Permalink
🚨 Fix clippy lints
Browse files Browse the repository at this point in the history
  • Loading branch information
aaronleopold committed Apr 20, 2024
1 parent 79592dc commit f82ee09
Showing 1 changed file with 5 additions and 11 deletions.
16 changes: 5 additions & 11 deletions core/src/config/stump_config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,7 @@ impl StumpConfig {
let toml_content_str = std::fs::read_to_string(stump_toml)?;
let toml_configs = toml::from_str::<PartialStumpConfig>(&toml_content_str)
.map_err(|e| {
eprintln!("Failed to parse Stump.toml: {}", e.to_string());
eprintln!("Failed to parse Stump.toml: {}", e);
CoreError::InitializationError(e.to_string())
})?;

Expand All @@ -183,29 +183,23 @@ impl StumpConfig {

if let Ok(port) = env::var(PORT_KEY) {
let port_u16 = port.parse::<u16>().map_err(|e| {
eprintln!("Failed to parse provided STUMP_PORT: {}", e.to_string());
eprintln!("Failed to parse provided STUMP_PORT: {}", e);
CoreError::InitializationError(e.to_string())
})?;
env_configs.port = Some(port_u16);
}

if let Ok(verbosity) = env::var(VERBOSITY_KEY) {
let verbosity_u64 = verbosity.parse::<u64>().map_err(|e| {
eprintln!(
"Failed to parse provided STUMP_VERBOSITY: {}",
e.to_string()
);
eprintln!("Failed to parse provided STUMP_VERBOSITY: {}", e);
CoreError::InitializationError(e.to_string())
})?;
env_configs.verbosity = Some(verbosity_u64);
}

if let Ok(pretty_logs) = env::var(PRETTY_LOGS_KEY) {
let pretty_logs_bool = pretty_logs.parse::<bool>().map_err(|e| {
eprintln!(
"Failed to parse provided STUMP_PRETTY_LOGS: {}",
e.to_string()
);
eprintln!("Failed to parse provided STUMP_PRETTY_LOGS: {}", e);
CoreError::InitializationError(e.to_string())
})?;
self.pretty_logs = pretty_logs_bool;
Expand Down Expand Up @@ -329,7 +323,7 @@ impl StumpConfig {
std::fs::write(
stump_toml.as_path(),
toml::to_string(&self).map_err(|e| {
eprintln!("Failed to serialize StumpConfig to toml: {}", e.to_string());
eprintln!("Failed to serialize StumpConfig to toml: {}", e);
CoreError::InitializationError(e.to_string())
})?,
)?;
Expand Down

0 comments on commit f82ee09

Please sign in to comment.