@@ -121,19 +121,6 @@ impl CdevPin<Output> {
121
121
}
122
122
123
123
impl < MODE > CdevPin < MODE > {
124
- #[ inline]
125
- fn request ( & self ) -> & Request {
126
- #[ cfg( not( feature = "async-tokio" ) ) ]
127
- {
128
- & self . req
129
- }
130
-
131
- #[ cfg( feature = "async-tokio" ) ]
132
- {
133
- self . req . as_ref ( )
134
- }
135
- }
136
-
137
124
/// Converts a pin state to a value, depending on
138
125
/// whether the pin is configured as active-low.
139
126
fn state_to_value ( & self , state : PinState ) -> Value {
@@ -189,20 +176,20 @@ impl<MODE> ErrorType for CdevPin<MODE> {
189
176
impl InputPin for CdevPin < Input > {
190
177
fn is_low ( & mut self ) -> Result < bool , Self :: Error > {
191
178
let low_value = self . state_to_value ( PinState :: Low ) ;
192
- Ok ( self . request ( ) . value ( self . line ) ? == low_value)
179
+ Ok ( self . req . as_ref ( ) . value ( self . line ) ? == low_value)
193
180
}
194
181
195
182
fn is_high ( & mut self ) -> Result < bool , Self :: Error > {
196
183
let high_value = self . state_to_value ( PinState :: High ) ;
197
- Ok ( self . request ( ) . value ( self . line ) ? == high_value)
184
+ Ok ( self . req . as_ref ( ) . value ( self . line ) ? == high_value)
198
185
}
199
186
}
200
187
201
188
impl OutputPin for CdevPin < Output > {
202
189
fn set_low ( & mut self ) -> Result < ( ) , Self :: Error > {
203
190
let new_value = self . state_to_value ( PinState :: Low ) ;
204
191
205
- self . request ( ) . set_value ( self . line , new_value) ?;
192
+ self . req . as_ref ( ) . set_value ( self . line , new_value) ?;
206
193
self . line_config . value = Some ( new_value) ;
207
194
208
195
Ok ( ( ) )
@@ -211,7 +198,7 @@ impl OutputPin for CdevPin<Output> {
211
198
fn set_high ( & mut self ) -> Result < ( ) , Self :: Error > {
212
199
let new_value = self . state_to_value ( PinState :: High ) ;
213
200
214
- self . request ( ) . set_value ( self . line , new_value) ?;
201
+ self . req . as_ref ( ) . set_value ( self . line , new_value) ?;
215
202
self . line_config . value = Some ( new_value) ;
216
203
217
204
Ok ( ( ) )
0 commit comments