Skip to content

Commit d8675fc

Browse files
author
zhangpeng
committed
Fix "unnecessary unsafe" warning
1 parent 8631223 commit d8675fc

File tree

1 file changed

+5
-7
lines changed

1 file changed

+5
-7
lines changed

src/dac.rs

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -53,14 +53,12 @@ pub fn dac<PINS>(_dac: DAC, _pins: PINS) -> PINS::Output
5353
where
5454
PINS: Pins<DAC>,
5555
{
56-
unsafe {
57-
// Enable and reset clock.
58-
let rcc = unsafe { &(*RCC::ptr()) };
59-
DAC::enable(rcc);
60-
DAC::reset(rcc);
56+
// Enable and reset clock.
57+
let rcc = unsafe { &(*RCC::ptr()) };
58+
DAC::enable(rcc);
59+
DAC::reset(rcc);
6160

62-
PINS::init()
63-
}
61+
PINS::init()
6462
}
6563

6664
macro_rules! dac {

0 commit comments

Comments
 (0)