mirror of https://github.com/eldruin/ds323x-rs
Simplify code
parent
eb87a741f6
commit
c7da098f80
|
@ -123,10 +123,8 @@ where
|
||||||
.transfer(&mut data)
|
.transfer(&mut data)
|
||||||
.map_err(Error::Comm);
|
.map_err(Error::Comm);
|
||||||
self.cs.set_high();
|
self.cs.set_high();
|
||||||
match result {
|
let result = result?;
|
||||||
Ok(result) => Ok(result[1]),
|
Ok(result[1])
|
||||||
Err(e) => Err(e)
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
fn read_data(&mut self, mut payload: &mut [u8]) -> Result<(), Error<Self::Error>> {
|
fn read_data(&mut self, mut payload: &mut [u8]) -> Result<(), Error<Self::Error>> {
|
||||||
|
|
Loading…
Reference in New Issue