Skip to content

Commit 5e2c733

Browse files
committed
Update examples
1 parent b59f9e8 commit 5e2c733

File tree

1 file changed

+12
-12
lines changed

1 file changed

+12
-12
lines changed

src/lib.rs

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -85,16 +85,16 @@
8585
//! fn get_timeout(&self) -> Self::Time;
8686
//!
8787
//! /// Pauses the timer
88-
//! fn pause(&self);
88+
//! fn pause(&mut self);
8989
//!
9090
//! /// Restarts the timer count
91-
//! fn restart(&self);
91+
//! fn restart(&mut self);
9292
//!
9393
//! /// Resumes the timer count
94-
//! fn resume(&self);
94+
//! fn resume(&mut self);
9595
//!
9696
//! /// Sets a new timeout
97-
//! fn set_timeout<T>(&self, ticks: T) where T: Into<Self::Time>;
97+
//! fn set_timeout<T>(&mut self, ticks: T) where T: Into<Self::Time>;
9898
//!
9999
//! /// "waits" until the timer times out
100100
//! fn wait(&self) -> nb::Result<(), !>;
@@ -146,7 +146,7 @@
146146
//! {
147147
//! type Error = Error;
148148
//!
149-
//! fn read(&self) -> nb::Result<u8, Error> {
149+
//! fn read(&mut self) -> nb::Result<u8, Error> {
150150
//! // read the status register
151151
//! let sr = self.0.sr.read();
152152
//!
@@ -172,7 +172,7 @@
172172
//! {
173173
//! type Error = Error;
174174
//!
175-
//! fn write(&self, byte: u8) -> nb::Result<(), Error> {
175+
//! fn write(&mut self, byte: u8) -> nb::Result<(), Error> {
176176
//! // Very similar to the above implementation
177177
//! Ok(())
178178
//! }
@@ -203,7 +203,7 @@
203203
//! impl hal::serial::Read<u8> for Serial1 {
204204
//! type Error = !;
205205
//!
206-
//! fn read(&self) -> Result<u8, nb::Error<Self::Error>> {
206+
//! fn read(&mut self) -> Result<u8, nb::Error<Self::Error>> {
207207
//! hal::serial::Read::read(&Serial(&*USART1.lock()))
208208
//! }
209209
//! }
@@ -419,7 +419,7 @@
419419
//!
420420
//! use hal::prelude::*;
421421
//!
422-
//! fn write_all<S>(serial: &S, buffer: &[u8]) -> Result<(), S::Error>
422+
//! fn write_all<S>(serial: &mut S, buffer: &[u8]) -> Result<(), S::Error>
423423
//! where
424424
//! S: hal::serial::Write<u8>
425425
//! {
@@ -446,8 +446,8 @@
446446
//! }
447447
//!
448448
//! fn read_with_timeout<S, T>(
449-
//! serial: &S,
450-
//! timer: &T,
449+
//! serial: &mut S,
450+
//! timer: &mut T,
451451
//! timeout: T::Time,
452452
//! ) -> Result<u8, Error<S::Error>>
453453
//! where
@@ -519,7 +519,7 @@
519519
//!
520520
//! use hal::prelude::*;
521521
//!
522-
//! fn flush<S>(serial: &S, cb: &mut CircularBuffer) -> Result<(), S::Error>
522+
//! fn flush<S>(serial: &mut S, cb: &mut CircularBuffer) -> Result<(), S::Error>
523523
//! where
524524
//! S: hal::serial::Write<u8>,
525525
//! {
@@ -565,7 +565,7 @@
565565
//! let serial = SERIAL.lock();
566566
//! let buffer = BUFFER.lock();
567567
//!
568-
//! flush(&serial, &mut buffer).unwrap();
568+
//! flush(&mut serial, &mut buffer).unwrap();
569569
//! }
570570
//! ```
571571
//!

0 commit comments

Comments
 (0)