Skip to content

Commit

Permalink
some clippy suggestions
Browse files Browse the repository at this point in the history
  • Loading branch information
TDHolmes committed Jul 2, 2022
1 parent 2aedaf2 commit e4d2c56
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion ep-dwt/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,10 @@ impl<const FREQ: u32> DwtProfiler<FREQ> {
///
/// # Panics
/// asserts that the compile time constant `FREQ` matches the runtime provided `sysclk`
///
/// # Errors
/// If the [`DWT`] doesn't have a cycle counter or configuration of it fails, we can return
/// an error.
pub fn new(dcb: &mut DCB, mut dwt: DWT, sysclk: u32) -> Result<Self, DwtProfilerError> {
assert!(FREQ == sysclk);

Expand All @@ -116,7 +120,7 @@ impl<const FREQ: u32> DwtProfiler<FREQ> {
emit: EmitOption::WatchpointDebugEvent,
compare: 4_294_967_295, // just before overflow (2**32 - 1)
}))
.map_err(|_conf_err| DwtProfilerError::CycleCounterInvalidSettings)?
.map_err(|_conf_err| DwtProfilerError::CycleCounterInvalidSettings)?;
}

Ok(Self { dwt })
Expand Down

0 comments on commit e4d2c56

Please sign in to comment.