From 0a1664fdac51ef1d68582a2492506cd051e4a82b Mon Sep 17 00:00:00 2001 From: Carl Lerche Date: Wed, 16 Dec 2020 20:54:47 -0800 Subject: [PATCH 1/2] remove unused Buf implementation. The implementation of `Buf` for `Option<[u8; 1]>` was added to support `IntoBuf`. The `IntoBuf` trait has since been removed. Closes #444 --- src/buf/buf_impl.rs | 29 ----------------------------- 1 file changed, 29 deletions(-) diff --git a/src/buf/buf_impl.rs b/src/buf/buf_impl.rs index 04c2f7c40..3c596f164 100644 --- a/src/buf/buf_impl.rs +++ b/src/buf/buf_impl.rs @@ -1032,35 +1032,6 @@ impl Buf for &[u8] { } } -impl Buf for Option<[u8; 1]> { - fn remaining(&self) -> usize { - if self.is_some() { - 1 - } else { - 0 - } - } - - fn bytes(&self) -> &[u8] { - self.as_ref() - .map(AsRef::as_ref) - .unwrap_or(Default::default()) - } - - fn advance(&mut self, cnt: usize) { - if cnt == 0 { - return; - } - - if self.is_none() { - panic!("overflow"); - } else { - assert_eq!(1, cnt); - *self = None; - } - } -} - #[cfg(feature = "std")] impl> Buf for std::io::Cursor { fn remaining(&self) -> usize { From 2c19a433b1fe42167bf4e29f8eb36a48cfeabc40 Mon Sep 17 00:00:00 2001 From: Carl Lerche Date: Wed, 16 Dec 2020 21:03:18 -0800 Subject: [PATCH 2/2] fix benches --- benches/buf.rs | 1 - 1 file changed, 1 deletion(-) diff --git a/benches/buf.rs b/benches/buf.rs index 77b0633ee..4b5d2864a 100644 --- a/benches/buf.rs +++ b/benches/buf.rs @@ -159,7 +159,6 @@ macro_rules! bench_group { mod get_u8 { use super::*; bench_group!(get_u8); - bench!(option, option); } mod get_u16 { use super::*;