From 0c57dcb1dddc2e3da8360ad6ac31759f1f24e0a0 Mon Sep 17 00:00:00 2001 From: gered Date: Thu, 20 May 2021 13:44:15 -0400 Subject: [PATCH] relax ReadFixedLengthByteArray generic constraint a bit probably not a big deal, but meh, why not --- psoutils/src/bytes.rs | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/psoutils/src/bytes.rs b/psoutils/src/bytes.rs index ac59e99..ad1f818 100644 --- a/psoutils/src/bytes.rs +++ b/psoutils/src/bytes.rs @@ -1,7 +1,3 @@ -use std::io::Error; - -use byteorder::ReadBytesExt; - pub trait FixedLengthByteArrays { fn as_unpadded_slice(&self) -> &[u8]; fn to_array(&self) -> [u8; N]; @@ -29,8 +25,8 @@ pub trait ReadFixedLengthByteArray { fn read_bytes(&mut self) -> Result<[u8; N], std::io::Error>; } -impl ReadFixedLengthByteArray for T { - fn read_bytes(&mut self) -> Result<[u8; N], Error> { +impl ReadFixedLengthByteArray for T { + fn read_bytes(&mut self) -> Result<[u8; N], std::io::Error> { assert_ne!(N, 0); let mut array = [0u8; N]; self.read_exact(&mut array)?;