diff --git a/Cargo.toml b/Cargo.toml index bc4d670cb..9feb647db 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -25,7 +25,6 @@ std = [] [dependencies] serde = { version = "1.0", optional = true } -either = { version = "1.5", default-features = false, optional = true } [dev-dependencies] loom = "0.2.10" diff --git a/azure-pipelines.yml b/azure-pipelines.yml index 416e1fb7e..18b59745d 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -30,7 +30,6 @@ jobs: cross: true features: - serde - - either # Nightly - template: ci/azure-test-stable.yml diff --git a/src/either.rs b/src/either.rs deleted file mode 100644 index 9a0fd396f..000000000 --- a/src/either.rs +++ /dev/null @@ -1,93 +0,0 @@ -use crate::{Buf, BufMut}; - -use either::Either; -use either::Either::*; - -#[cfg(feature = "std")] -use std::io::IoSlice; -#[cfg(feature = "std")] -use crate::buf::IoSliceMut; - -impl Buf for Either -where - L: Buf, - R: Buf, -{ - fn remaining(&self) -> usize { - match *self { - Left(ref b) => b.remaining(), - Right(ref b) => b.remaining(), - } - } - - fn bytes(&self) -> &[u8] { - match *self { - Left(ref b) => b.bytes(), - Right(ref b) => b.bytes(), - } - } - - #[cfg(feature = "std")] - fn bytes_vectored<'a>(&'a self, dst: &mut [IoSlice<'a>]) -> usize { - match *self { - Left(ref b) => b.bytes_vectored(dst), - Right(ref b) => b.bytes_vectored(dst), - } - } - - fn advance(&mut self, cnt: usize) { - match *self { - Left(ref mut b) => b.advance(cnt), - Right(ref mut b) => b.advance(cnt), - } - } - - fn copy_to_slice(&mut self, dst: &mut [u8]) { - match *self { - Left(ref mut b) => b.copy_to_slice(dst), - Right(ref mut b) => b.copy_to_slice(dst), - } - } -} - -impl BufMut for Either -where - L: BufMut, - R: BufMut, -{ - fn remaining_mut(&self) -> usize { - match *self { - Left(ref b) => b.remaining_mut(), - Right(ref b) => b.remaining_mut(), - } - } - - fn bytes_mut(&mut self) -> &mut [core::mem::MaybeUninit] { - match *self { - Left(ref mut b) => b.bytes_mut(), - Right(ref mut b) => b.bytes_mut(), - } - } - - #[cfg(feature = "std")] - fn bytes_vectored_mut<'a>(&'a mut self, dst: &mut [IoSliceMut<'a>]) -> usize { - match *self { - Left(ref mut b) => b.bytes_vectored_mut(dst), - Right(ref mut b) => b.bytes_vectored_mut(dst), - } - } - - unsafe fn advance_mut(&mut self, cnt: usize) { - match *self { - Left(ref mut b) => b.advance_mut(cnt), - Right(ref mut b) => b.advance_mut(cnt), - } - } - - fn put_slice(&mut self, src: &[u8]) { - match *self { - Left(ref mut b) => b.put_slice(src), - Right(ref mut b) => b.put_slice(src), - } - } -} diff --git a/src/lib.rs b/src/lib.rs index 69def08b5..c565aa7a0 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -96,11 +96,6 @@ pub use crate::bytes::Bytes; #[cfg(feature = "serde")] mod serde; -// Optional `Either` support -#[cfg(feature = "either")] -mod either; - - #[inline(never)] #[cold] fn abort() -> ! {