From 214376fafa5ff13cdbdc0ed02ab23a66622ee368 Mon Sep 17 00:00:00 2001 From: Terah Date: Tue, 30 Jul 2024 00:28:43 +0200 Subject: [PATCH] Formatting --- src/buffer.rs | 2 +- src/reader.rs | 2 +- tests/buffer.rs | 10 ++++++++-- tests/reader.rs | 10 ++++++++-- 4 files changed, 18 insertions(+), 6 deletions(-) diff --git a/src/buffer.rs b/src/buffer.rs index 64034f7..f6b860d 100644 --- a/src/buffer.rs +++ b/src/buffer.rs @@ -508,7 +508,7 @@ impl ByteBuffer { pub fn read_i64(&mut self) -> Result { Ok(self.read_u64()? as i64) } - + /// Read a sixteen bytes long value, or return an IO error if not enough bytes are available. /// _Note_: This method resets the read and write cursor for bitwise reading. /// diff --git a/src/reader.rs b/src/reader.rs index e89ed90..4eae641 100644 --- a/src/reader.rs +++ b/src/reader.rs @@ -248,7 +248,7 @@ impl<'a> ByteReader<'a> { pub fn read_i128(&mut self) -> Result { Ok(self.read_u128()? as i128) } - + /// Read a 32 bits floating point value, or return an IO error if not enough bytes are available. /// _Note_: This method resets the read and write cursor for bitwise reading. pub fn read_f32(&mut self) -> Result { diff --git a/tests/buffer.rs b/tests/buffer.rs index 486d7fa..a3e7adf 100644 --- a/tests/buffer.rs +++ b/tests/buffer.rs @@ -125,7 +125,10 @@ fn test_u64_little_endian() { fn test_u128() { let mut buffer = ByteBuffer::new(); buffer.write_u128(0xF0E1D2C3B4A59687F7E6D5C4B3A29180); - assert_eq!(buffer.read_u128().unwrap(), 0xF0E1D2C3B4A59687F7E6D5C4B3A29180); + assert_eq!( + buffer.read_u128().unwrap(), + 0xF0E1D2C3B4A59687F7E6D5C4B3A29180 + ); } #[test] @@ -133,7 +136,10 @@ fn test_u128_little_endian() { let mut buffer = ByteBuffer::new(); buffer.set_endian(Endian::LittleEndian); buffer.write_u128(0xF0E1D2C3B4A59687F7E6D5C4B3A29180); - assert_eq!(buffer.read_u128().unwrap(), 0xF0E1D2C3B4A59687F7E6D5C4B3A29180); + assert_eq!( + buffer.read_u128().unwrap(), + 0xF0E1D2C3B4A59687F7E6D5C4B3A29180 + ); } #[test] diff --git a/tests/reader.rs b/tests/reader.rs index b7d849f..41bb8d0 100644 --- a/tests/reader.rs +++ b/tests/reader.rs @@ -139,7 +139,10 @@ fn test_u128() { let mut buffer = ByteBuffer::new(); buffer.write_u128(0xF0E1D2C3B4A59687F7E6D5C4B3A29180); let mut reader = ByteReader::from(buffer.as_bytes()); - assert_eq!(reader.read_u128().unwrap(), 0xF0E1D2C3B4A59687F7E6D5C4B3A29180); + assert_eq!( + reader.read_u128().unwrap(), + 0xF0E1D2C3B4A59687F7E6D5C4B3A29180 + ); } #[test] @@ -149,7 +152,10 @@ fn test_u128_little_endian() { buffer.write_u128(0xF0E1D2C3B4A59687F7E6D5C4B3A29180); let mut reader = ByteReader::from(buffer.as_bytes()); reader.set_endian(Endian::LittleEndian); - assert_eq!(reader.read_u128().unwrap(), 0xF0E1D2C3B4A59687F7E6D5C4B3A29180); + assert_eq!( + reader.read_u128().unwrap(), + 0xF0E1D2C3B4A59687F7E6D5C4B3A29180 + ); } #[test]