From 5485d9655e2ab3a6d04e5f69b246f5db4d2c5936 Mon Sep 17 00:00:00 2001 From: Diego Barrios Romero Date: Wed, 21 Nov 2018 09:35:37 +0100 Subject: Code formatting --- src/conversion.rs | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) (limited to 'src/conversion.rs') diff --git a/src/conversion.rs b/src/conversion.rs index 5e7751c..644ed4a 100644 --- a/src/conversion.rs +++ b/src/conversion.rs @@ -1,7 +1,7 @@ -use { ic, private, Error }; +use {ic, private, Error}; #[doc(hidden)] -pub trait ConvertThreshold : private::Sealed { +pub trait ConvertThreshold: private::Sealed { fn convert_threshold(value: i16) -> Result>; } @@ -21,7 +21,7 @@ impl ConvertThreshold for ic::Resolution16Bit { } #[doc(hidden)] -pub trait ConvertMeasurement : private::Sealed { +pub trait ConvertMeasurement: private::Sealed { fn convert_measurement(register_data: u16) -> i16; } @@ -32,8 +32,7 @@ impl ConvertMeasurement for ic::Resolution12Bit { if is_negative { let value = 0b1111_0000_0000_0000 | (value >> 4); value as i16 - } - else { + } else { (value >> 4) as i16 } } @@ -69,7 +68,7 @@ mod tests { fn assert_invalid_input_data(result: Result>) { match result { Err(Error::InvalidInputData) => (), - _ => panic!("InvalidInputData error was not returned.") + _ => panic!("InvalidInputData error was not returned."), } } -- cgit v1.2.3-54-g00ecf