Skip to content

Commit e4d2c56

Browse files
committed
some clippy suggestions
1 parent 2aedaf2 commit e4d2c56

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

ep-dwt/src/lib.rs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,6 +90,10 @@ impl<const FREQ: u32> DwtProfiler<FREQ> {
9090
///
9191
/// # Panics
9292
/// asserts that the compile time constant `FREQ` matches the runtime provided `sysclk`
93+
///
94+
/// # Errors
95+
/// If the [`DWT`] doesn't have a cycle counter or configuration of it fails, we can return
96+
/// an error.
9397
pub fn new(dcb: &mut DCB, mut dwt: DWT, sysclk: u32) -> Result<Self, DwtProfilerError> {
9498
assert!(FREQ == sysclk);
9599

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

122126
Ok(Self { dwt })

0 commit comments

Comments
 (0)