From c7da098f803f6b370af9244777cd5630697dcead Mon Sep 17 00:00:00 2001 From: Diego Barrios Romero Date: Fri, 16 Nov 2018 19:12:36 +0100 Subject: [PATCH] Simplify code --- src/interface.rs | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/src/interface.rs b/src/interface.rs index c893359..f9a2d38 100644 --- a/src/interface.rs +++ b/src/interface.rs @@ -123,10 +123,8 @@ where .transfer(&mut data) .map_err(Error::Comm); self.cs.set_high(); - match result { - Ok(result) => Ok(result[1]), - Err(e) => Err(e) - } + let result = result?; + Ok(result[1]) } fn read_data(&mut self, mut payload: &mut [u8]) -> Result<(), Error> {