Skip to content

Commit

Permalink
Make ConfigError enum follow naming convention (#2855)
Browse files Browse the repository at this point in the history
* Make `ConfigError` follow naming convention

* changelog entry

* !(changelog entry)
  • Loading branch information
playfulFence authored Dec 20, 2024
1 parent 62c7294 commit 8b16365
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions esp-hal/src/i2c/master/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -132,15 +132,15 @@ impl core::fmt::Display for Error {
#[non_exhaustive]
pub enum ConfigError {
/// Provided bus frequency is invalid for the current configuration.
InvalidFrequency,
FrequencyInvalid,
}

impl core::error::Error for ConfigError {}

impl core::fmt::Display for ConfigError {
fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
match self {
ConfigError::InvalidFrequency => write!(
ConfigError::FrequencyInvalid => write!(
f,
"Provided bus frequency is invalid for the current configuration"
),
Expand Down Expand Up @@ -932,7 +932,7 @@ fn configure_clock(
#[cfg(not(esp32))]
let scl_wait_high_period = scl_wait_high_period
.try_into()
.map_err(|_| ConfigError::InvalidFrequency)?;
.map_err(|_| ConfigError::FrequencyInvalid)?;

register_block.scl_high_period().write(|w| {
#[cfg(not(esp32))] // ESP32 does not have a wait_high field
Expand Down

0 comments on commit 8b16365

Please sign in to comment.