Skip to content

Commit a5ab6a6

Browse files
committed
Use fully qualified syntax
1 parent bc25730 commit a5ab6a6

File tree

13 files changed

+53
-53
lines changed

13 files changed

+53
-53
lines changed

src/adc.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ pub mod nb {
5555
type ID = T::ID;
5656

5757
fn channel(&self) -> Self::ID {
58-
(*self).channel()
58+
T::channel(self)
5959
}
6060
}
6161

@@ -108,7 +108,7 @@ pub mod nb {
108108
type Error = T::Error;
109109

110110
fn read(&mut self, pin: &mut Pin) -> nb::Result<Word, Self::Error> {
111-
(*self).read(pin)
111+
T::read(self, pin)
112112
}
113113
}
114114
}

src/capture.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -105,26 +105,26 @@ pub mod nb {
105105
type Capture = T::Capture;
106106

107107
fn capture(&mut self, channel: Self::Channel) -> nb::Result<Self::Capture, Self::Error> {
108-
(*self).capture(channel)
108+
T::capture(self, channel)
109109
}
110110

111111
fn disable(&mut self, channel: Self::Channel) -> Result<(), Self::Error> {
112-
(*self).disable(channel)
112+
T::disable(self, channel)
113113
}
114114

115115
fn enable(&mut self, channel: Self::Channel) -> Result<(), Self::Error> {
116-
(*self).enable(channel)
116+
T::enable(self, channel)
117117
}
118118

119119
fn get_resolution(&self) -> Result<Self::Time, Self::Error> {
120-
(**self).get_resolution()
120+
T::get_resolution(self)
121121
}
122122

123123
fn set_resolution<R>(&mut self, resolution: R) -> Result<(), Self::Error>
124124
where
125125
R: Into<Self::Time>,
126126
{
127-
(*self).set_resolution(resolution)
127+
T::set_resolution(self, resolution)
128128
}
129129
}
130130
}

src/delay.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ pub mod blocking {
2525
type Error = T::Error;
2626

2727
fn delay_ms(&mut self, ms: UXX) -> Result<(), Self::Error> {
28-
(*self).delay_ms(ms)
28+
T::delay_ms(self, ms)
2929
}
3030
}
3131

@@ -45,7 +45,7 @@ pub mod blocking {
4545
type Error = T::Error;
4646

4747
fn delay_us(&mut self, us: UXX) -> Result<(), Self::Error> {
48-
(*self).delay_us(us)
48+
T::delay_us(self, us)
4949
}
5050
}
5151
}

src/digital.rs

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -81,15 +81,15 @@ pub mod blocking {
8181
type Error = T::Error;
8282

8383
fn set_low(&mut self) -> Result<(), Self::Error> {
84-
(*self).set_low()
84+
T::set_low(self)
8585
}
8686

8787
fn set_high(&mut self) -> Result<(), Self::Error> {
88-
(*self).set_high()
88+
T::set_high(self)
8989
}
9090

9191
fn set_state(&mut self, state: PinState) -> Result<(), Self::Error> {
92-
(*self).set_state(state)
92+
T::set_state(self, state)
9393
}
9494
}
9595

@@ -108,11 +108,11 @@ pub mod blocking {
108108

109109
impl<T: StatefulOutputPin> StatefulOutputPin for &mut T {
110110
fn is_set_high(&self) -> Result<bool, Self::Error> {
111-
(**self).is_set_high()
111+
T::is_set_high(self)
112112
}
113113

114114
fn is_set_low(&self) -> Result<bool, Self::Error> {
115-
(**self).is_set_low()
115+
T::is_set_low(self)
116116
}
117117
}
118118

@@ -134,7 +134,7 @@ pub mod blocking {
134134
type Error = T::Error;
135135

136136
fn toggle(&mut self) -> Result<(), Self::Error> {
137-
(*self).toggle()
137+
T::toggle(self)
138138
}
139139
}
140140

@@ -154,11 +154,11 @@ pub mod blocking {
154154
type Error = T::Error;
155155

156156
fn is_high(&self) -> Result<bool, Self::Error> {
157-
(*self).is_high()
157+
T::is_high(self)
158158
}
159159

160160
fn is_low(&self) -> Result<bool, Self::Error> {
161-
(*self).is_low()
161+
T::is_low(self)
162162
}
163163
}
164164

src/i2c.rs

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -151,7 +151,7 @@ pub mod blocking {
151151
type Error = T::Error;
152152

153153
fn read(&mut self, address: A, buffer: &mut [u8]) -> Result<(), Self::Error> {
154-
(*self).read(address, buffer)
154+
T::read(self, address, buffer)
155155
}
156156
}
157157

@@ -183,7 +183,7 @@ pub mod blocking {
183183
type Error = T::Error;
184184

185185
fn write(&mut self, address: A, bytes: &[u8]) -> Result<(), Self::Error> {
186-
(*self).write(address, bytes)
186+
T::write(self, address, bytes)
187187
}
188188
}
189189

@@ -209,7 +209,7 @@ pub mod blocking {
209209
where
210210
B: IntoIterator<Item = u8>,
211211
{
212-
(*self).write_iter(address, bytes)
212+
T::write_iter(self, address, bytes)
213213
}
214214
}
215215

@@ -257,7 +257,7 @@ pub mod blocking {
257257
bytes: &[u8],
258258
buffer: &mut [u8],
259259
) -> Result<(), Self::Error> {
260-
(*self).write_read(address, bytes, buffer)
260+
T::write_read(self, address, bytes, buffer)
261261
}
262262
}
263263

@@ -294,7 +294,7 @@ pub mod blocking {
294294
where
295295
B: IntoIterator<Item = u8>,
296296
{
297-
(*self).write_iter_read(address, bytes, buffer)
297+
T::write_iter_read(self, address, bytes, buffer)
298298
}
299299
}
300300

@@ -344,7 +344,7 @@ pub mod blocking {
344344
address: A,
345345
operations: &mut [Operation<'a>],
346346
) -> Result<(), Self::Error> {
347-
(*self).exec(address, operations)
347+
T::exec(self, address, operations)
348348
}
349349
}
350350

@@ -380,7 +380,7 @@ pub mod blocking {
380380
where
381381
O: IntoIterator<Item = Operation<'a>>,
382382
{
383-
(*self).exec_iter(address, operations)
383+
T::exec_iter(self, address, operations)
384384
}
385385
}
386386
}

src/pwm.rs

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -112,38 +112,38 @@ pub mod blocking {
112112
type Duty = T::Duty;
113113

114114
fn disable(&mut self, channel: &Self::Channel) -> Result<(), Self::Error> {
115-
(*self).disable(channel)
115+
T::disable(self, channel)
116116
}
117117

118118
fn enable(&mut self, channel: &Self::Channel) -> Result<(), Self::Error> {
119-
(*self).enable(channel)
119+
T::enable(self, channel)
120120
}
121121

122122
fn get_period(&self) -> Result<Self::Time, Self::Error> {
123-
(**self).get_period()
123+
T::get_period(self)
124124
}
125125

126126
fn get_duty(&self, channel: &Self::Channel) -> Result<Self::Duty, Self::Error> {
127-
(**self).get_duty(channel)
127+
T::get_duty(self, channel)
128128
}
129129

130130
fn get_max_duty(&self) -> Result<Self::Duty, Self::Error> {
131-
(**self).get_max_duty()
131+
T::get_max_duty(self)
132132
}
133133

134134
fn set_duty(
135135
&mut self,
136136
channel: &Self::Channel,
137137
duty: Self::Duty,
138138
) -> Result<(), Self::Error> {
139-
(*self).set_duty(channel, duty)
139+
T::set_duty(self, channel, duty)
140140
}
141141

142142
fn set_period<P>(&mut self, period: P) -> Result<(), Self::Error>
143143
where
144144
P: Into<Self::Time>,
145145
{
146-
(*self).set_period(period)
146+
T::set_period(self, period)
147147
}
148148
}
149149

@@ -185,23 +185,23 @@ pub mod blocking {
185185
type Duty = T::Duty;
186186

187187
fn disable(&mut self) -> Result<(), Self::Error> {
188-
(*self).disable()
188+
T::disable(self)
189189
}
190190

191191
fn enable(&mut self) -> Result<(), Self::Error> {
192-
(*self).enable()
192+
T::enable(self)
193193
}
194194

195195
fn get_duty(&self) -> Result<Self::Duty, Self::Error> {
196-
(**self).get_duty()
196+
T::get_duty(self)
197197
}
198198

199199
fn get_max_duty(&self) -> Result<Self::Duty, Self::Error> {
200-
(**self).get_max_duty()
200+
T::get_max_duty(self)
201201
}
202202

203203
fn set_duty(&mut self, duty: Self::Duty) -> Result<(), Self::Error> {
204-
(*self).set_duty(duty)
204+
T::set_duty(self, duty)
205205
}
206206
}
207207
}

src/qei.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -88,11 +88,11 @@ pub mod blocking {
8888
type Count = T::Count;
8989

9090
fn count(&self) -> Result<Self::Count, Self::Error> {
91-
(*self).count()
91+
T::count(self)
9292
}
9393

9494
fn direction(&self) -> Result<Direction, Self::Error> {
95-
(*self).direction()
95+
T::direction(self)
9696
}
9797
}
9898
}

src/serial/blocking.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,10 +27,10 @@ impl<T: Write<Word>, Word> Write<Word> for &mut T {
2727
type Error = T::Error;
2828

2929
fn write(&mut self, buffer: &[Word]) -> Result<(), Self::Error> {
30-
(*self).write(buffer)
30+
T::write(self, buffer)
3131
}
3232

3333
fn flush(&mut self) -> Result<(), Self::Error> {
34-
(*self).flush()
34+
T::flush(self)
3535
}
3636
}

src/serial/nb.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ impl<T: Read<Word>, Word> Read<Word> for &mut T {
1616
type Error = T::Error;
1717

1818
fn read(&mut self) -> nb::Result<Word, Self::Error> {
19-
(*self).read()
19+
T::read(self)
2020
}
2121
}
2222

@@ -36,10 +36,10 @@ impl<T: Write<Word>, Word> Write<Word> for &mut T {
3636
type Error = T::Error;
3737

3838
fn write(&mut self, word: Word) -> nb::Result<(), Self::Error> {
39-
(*self).write(word)
39+
T::write(self, word)
4040
}
4141

4242
fn flush(&mut self) -> nb::Result<(), Self::Error> {
43-
(*self).flush()
43+
T::flush(self)
4444
}
4545
}

src/spi/blocking.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ impl<T: Transfer<W>, W> Transfer<W> for &mut T {
1919
type Error = T::Error;
2020

2121
fn transfer(&mut self, words: &mut [W]) -> Result<(), Self::Error> {
22-
(*self).transfer(words)
22+
T::transfer(self, words)
2323
}
2424
}
2525

@@ -36,7 +36,7 @@ impl<T: Write<W>, W> Write<W> for &mut T {
3636
type Error = T::Error;
3737

3838
fn write(&mut self, words: &[W]) -> Result<(), Self::Error> {
39-
(*self).write(words)
39+
T::write(self, words)
4040
}
4141
}
4242

@@ -58,7 +58,7 @@ impl<T: WriteIter<W>, W> WriteIter<W> for &mut T {
5858
where
5959
WI: IntoIterator<Item = W>,
6060
{
61-
(*self).write_iter(words)
61+
T::write_iter(self, words)
6262
}
6363
}
6464

@@ -87,6 +87,6 @@ impl<T: Transactional<W>, W: 'static> Transactional<W> for &mut T {
8787
type Error = T::Error;
8888

8989
fn exec<'a>(&mut self, operations: &mut [Operation<'a, W>]) -> Result<(), Self::Error> {
90-
(*self).exec(operations)
90+
T::exec(self, operations)
9191
}
9292
}

0 commit comments

Comments
 (0)