Skip to content

Commit 59ac083

Browse files
authored
Merge pull request #94 from Sh3Rm4n/clippy
Deal with a few warnings
2 parents 21310f9 + 6b0eebc commit 59ac083

File tree

3 files changed

+5
-5
lines changed

3 files changed

+5
-5
lines changed

examples/usb_serial.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -98,6 +98,6 @@ fn main() -> ! {
9898
_ => {}
9999
}
100100

101-
led.set_low(); // Turn off
101+
led.set_low().ok(); // Turn off
102102
}
103103
}

src/time.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -102,12 +102,12 @@ impl MonoTimer {
102102
}
103103

104104
/// Returns the frequency at which the monotonic timer is operating at
105-
pub fn frequency(&self) -> Hertz {
105+
pub fn frequency(self) -> Hertz {
106106
self.frequency
107107
}
108108

109109
/// Returns an `Instant` corresponding to "now"
110-
pub fn now(&self) -> Instant {
110+
pub fn now(self) -> Instant {
111111
Instant {
112112
now: DWT::get_cycle_count(),
113113
}
@@ -122,7 +122,7 @@ pub struct Instant {
122122

123123
impl Instant {
124124
/// Ticks elapsed since the `Instant` was created
125-
pub fn elapsed(&self) -> u32 {
125+
pub fn elapsed(self) -> u32 {
126126
DWT::get_cycle_count().wrapping_sub(self.now)
127127
}
128128
}

src/usb.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ unsafe impl UsbPeripheral for Peripheral {
3030
const EP_MEMORY_SIZE: usize = 1024;
3131

3232
fn enable() {
33-
let rcc = unsafe { (&*RCC::ptr()) };
33+
let rcc = unsafe { &*RCC::ptr() };
3434

3535
cortex_m::interrupt::free(|_| {
3636
// Enable USB peripheral

0 commit comments

Comments
 (0)