Skip to content

Commit b59f9e8

Browse files
committed
Change &self to &mut self, where appropriate
1 parent dbafdc7 commit b59f9e8

File tree

2 files changed

+16
-16
lines changed

2 files changed

+16
-16
lines changed

src/lib.rs

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -660,21 +660,21 @@ pub trait Capture {
660660
/// NOTE that you must multiply the returned value by the *resolution* of
661661
/// this `Capture` interface to get a human time unit (e.g. seconds)
662662
fn capture(
663-
&self,
663+
&mut self,
664664
channel: Self::Channel,
665665
) -> nb::Result<Self::Capture, Self::Error>;
666666

667667
/// Disables a capture `channel`
668-
fn disable(&self, channel: Self::Channel);
668+
fn disable(&mut self, channel: Self::Channel);
669669

670670
/// Enables a capture `channel`
671-
fn enable(&self, channel: Self::Channel);
671+
fn enable(&mut self, channel: Self::Channel);
672672

673673
/// Returns the current resolution
674674
fn get_resolution(&self) -> Self::Time;
675675

676676
/// Sets the resolution of the capture timer
677-
fn set_resolution<R>(&self, resolution: R)
677+
fn set_resolution<R>(&mut self, resolution: R)
678678
where
679679
R: Into<Self::Time>;
680680
}
@@ -715,10 +715,10 @@ pub trait Pwm {
715715
type Duty;
716716

717717
/// Disables a PWM `channel`
718-
fn disable(&self, channel: Self::Channel);
718+
fn disable(&mut self, channel: Self::Channel);
719719

720720
/// Enables a PWM `channel`
721-
fn enable(&self, channel: Self::Channel);
721+
fn enable(&mut self, channel: Self::Channel);
722722

723723
/// Returns the current PWM period
724724
fn get_period(&self) -> Self::Time;
@@ -730,10 +730,10 @@ pub trait Pwm {
730730
fn get_max_duty(&self) -> Self::Duty;
731731

732732
/// Sets a new duty cycle
733-
fn set_duty(&self, channel: Self::Channel, duty: Self::Duty);
733+
fn set_duty(&mut self, channel: Self::Channel, duty: Self::Duty);
734734

735735
/// Sets a new PWM period
736-
fn set_period<P>(&self, period: P)
736+
fn set_period<P>(&mut self, period: P)
737737
where
738738
P: Into<Self::Time>;
739739
}
@@ -805,10 +805,10 @@ pub trait Spi<Word> {
805805
///
806806
/// **NOTE** A word must be sent to the slave before attempting to call this
807807
/// method.
808-
fn read(&self) -> nb::Result<Word, Self::Error>;
808+
fn read(&mut self) -> nb::Result<Word, Self::Error>;
809809

810810
/// Sends a word to the slave
811-
fn send(&self, word: Word) -> nb::Result<(), Self::Error>;
811+
fn send(&mut self, word: Word) -> nb::Result<(), Self::Error>;
812812
}
813813

814814
/// Timer used for timeouts
@@ -837,16 +837,16 @@ pub trait Timer {
837837
fn get_timeout(&self) -> Self::Time;
838838

839839
/// Pauses the timer
840-
fn pause(&self);
840+
fn pause(&mut self);
841841

842842
/// Restarts the timer count to zero
843-
fn restart(&self);
843+
fn restart(&mut self);
844844

845845
/// Resumes the timer count
846-
fn resume(&self);
846+
fn resume(&mut self);
847847

848848
/// Sets a new timeout
849-
fn set_timeout<T>(&self, timeout: T)
849+
fn set_timeout<T>(&mut self, timeout: T)
850850
where
851851
T: Into<Self::Time>;
852852

src/serial.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ pub trait Read<Word> {
1616
type Error;
1717

1818
/// Reads a single word from the serial interface
19-
fn read(&self) -> nb::Result<Word, Self::Error>;
19+
fn read(&mut self) -> nb::Result<Word, Self::Error>;
2020
}
2121

2222
/// Write half of a serial interface
@@ -25,5 +25,5 @@ pub trait Write<Word> {
2525
type Error;
2626

2727
/// Writes a single word to the serial interface
28-
fn write(&self, word: Word) -> nb::Result<(), Self::Error>;
28+
fn write(&mut self, word: Word) -> nb::Result<(), Self::Error>;
2929
}

0 commit comments

Comments
 (0)