File tree 1 file changed +4
-8
lines changed 1 file changed +4
-8
lines changed Original file line number Diff line number Diff line change 110
110
//! method.
111
111
//!
112
112
//! ```ignore
113
- //! fn main() {
114
- //! let mut peripherals = stm32f30x::Peripherals::take().unwrap();
115
- //! peripherals.GPIOA.odr.write(|w| w.bits(1));
116
- //! }
113
+ //! let mut peripherals = stm32f30x::Peripherals::take().unwrap();
114
+ //! peripherals.GPIOA.odr.write(|w| w.bits(1));
117
115
//! ```
118
116
//!
119
117
//! This method can only be successfully called *once* -- that's why the method returns an `Option`.
120
118
//! Subsequent calls to the method will result in a `None` value being returned.
121
119
//!
122
120
//! ```ignore
123
- //! fn main() {
124
- //! let ok = stm32f30x::Peripherals::take().unwrap();
125
- //! let panics = stm32f30x::Peripherals::take().unwrap();
126
- //! }
121
+ //! let ok = stm32f30x::Peripherals::take().unwrap();
122
+ //! let panics = stm32f30x::Peripherals::take().unwrap();
127
123
//! ```
128
124
//!
129
125
//! The singleton property can be *unsafely* bypassed using the `ptr` static method which is
You can’t perform that action at this time.
0 commit comments