From 3e2875f3d531a603c360756f4c2c6c2c50d223d6 Mon Sep 17 00:00:00 2001 From: Nikolay Volf Date: Sun, 17 Apr 2016 11:13:25 +0300 Subject: [PATCH] removing redundant implements --- util/src/bytes.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/util/src/bytes.rs b/util/src/bytes.rs index 47264db4d..231ad2512 100644 --- a/util/src/bytes.rs +++ b/util/src/bytes.rs @@ -282,12 +282,12 @@ impl FromRawBytes for u16 { /// Value that can be serialized from variable-length byte array pub trait FromRawBytesVariable : Sized { /// Create value from slice - fn from_bytes_var(d: &[u8], len: u64) -> Result; + fn from_bytes(d: &[u8]) -> Result; } impl FromRawBytesVariable for T where T: FromRawBytes { - fn from_bytes_var(bytes: &[u8], len: u64) -> Result { - match bytes.len().cmp(&len) { + fn from_bytes(bytes: &[u8],) -> Result { + match bytes.len().cmp(&::std::mem::size_of::()) { Ordering::Less => return Err(FromBytesError::NotLongEnough), Ordering::Greater => return Err(FromBytesError::TooLong), Ordering::Equal => ()