Skip to content

Commit

Permalink
Simplify Default for esp_log_level_t.
Browse files Browse the repository at this point in the history
  • Loading branch information
reitermarkus committed Mar 25, 2022
1 parent 12e5aec commit 3e1c7f0
Showing 1 changed file with 1 addition and 15 deletions.
16 changes: 1 addition & 15 deletions src/defaults.rs
Original file line number Diff line number Diff line change
Expand Up @@ -31,20 +31,6 @@ impl Default for wifi_init_config_t {

impl Default for esp_log_level_t {
fn default() -> Self {
let default_log_level = esp_log_level_t(CONFIG_LOG_DEFAULT_LEVEL);

if default_log_level >= esp_log_level_t::ESP_LOG_VERBOSE {
esp_log_level_t::ESP_LOG_VERBOSE
} else if default_log_level >= esp_log_level_t::ESP_LOG_DEBUG {
esp_log_level_t::ESP_LOG_DEBUG
} else if default_log_level >= esp_log_level_t::ESP_LOG_INFO {
esp_log_level_t::ESP_LOG_INFO
} else if default_log_level >= esp_log_level_t::ESP_LOG_WARN {
esp_log_level_t::ESP_LOG_WARN
} else if default_log_level >= esp_log_level_t::ESP_LOG_ERROR {
esp_log_level_t::ESP_LOG_ERROR
} else {
esp_log_level_t::ESP_LOG_NONE
}
esp_log_level_t(CONFIG_LOG_DEFAULT_LEVEL)
}
}

0 comments on commit 3e1c7f0

Please sign in to comment.