@@ -169,22 +169,22 @@ pub trait StatefulOutputPin: OutputPin {
169169 /// Is the pin in drive high mode?
170170 ///
171171 /// *NOTE* this does *not* read the electrical state of the pin.
172- fn is_set_high ( & self ) -> Result < bool , Self :: Error > ;
172+ fn is_set_high ( & mut self ) -> Result < bool , Self :: Error > ;
173173
174174 /// Is the pin in drive low mode?
175175 ///
176176 /// *NOTE* this does *not* read the electrical state of the pin.
177- fn is_set_low ( & self ) -> Result < bool , Self :: Error > ;
177+ fn is_set_low ( & mut self ) -> Result < bool , Self :: Error > ;
178178}
179179
180180impl < T : StatefulOutputPin + ?Sized > StatefulOutputPin for & mut T {
181181 #[ inline]
182- fn is_set_high ( & self ) -> Result < bool , Self :: Error > {
182+ fn is_set_high ( & mut self ) -> Result < bool , Self :: Error > {
183183 T :: is_set_high ( self )
184184 }
185185
186186 #[ inline]
187- fn is_set_low ( & self ) -> Result < bool , Self :: Error > {
187+ fn is_set_low ( & mut self ) -> Result < bool , Self :: Error > {
188188 T :: is_set_low ( self )
189189 }
190190}
@@ -205,20 +205,20 @@ impl<T: ToggleableOutputPin + ?Sized> ToggleableOutputPin for &mut T {
205205/// Single digital input pin.
206206pub trait InputPin : ErrorType {
207207 /// Is the input pin high?
208- fn is_high ( & self ) -> Result < bool , Self :: Error > ;
208+ fn is_high ( & mut self ) -> Result < bool , Self :: Error > ;
209209
210210 /// Is the input pin low?
211- fn is_low ( & self ) -> Result < bool , Self :: Error > ;
211+ fn is_low ( & mut self ) -> Result < bool , Self :: Error > ;
212212}
213213
214- impl < T : InputPin + ?Sized > InputPin for & T {
214+ impl < T : InputPin + ?Sized > InputPin for & mut T {
215215 #[ inline]
216- fn is_high ( & self ) -> Result < bool , Self :: Error > {
216+ fn is_high ( & mut self ) -> Result < bool , Self :: Error > {
217217 T :: is_high ( self )
218218 }
219219
220220 #[ inline]
221- fn is_low ( & self ) -> Result < bool , Self :: Error > {
221+ fn is_low ( & mut self ) -> Result < bool , Self :: Error > {
222222 T :: is_low ( self )
223223 }
224224}
0 commit comments