diff --git a/src/header/name.rs b/src/header/name.rs index 1200354..4a70283 100644 --- a/src/header/name.rs +++ b/src/header/name.rs @@ -1,7 +1,7 @@ use byte_str::ByteStr; use bytes::{Bytes, BytesMut}; -use std::{convert, fmt, mem}; +use std::{fmt, mem}; use std::borrow::Borrow; use std::hash::{Hash, Hasher}; use std::str::FromStr; @@ -32,13 +32,6 @@ pub struct HeaderName { inner: Repr, } -impl convert::Into for HeaderName { - #[inline] - fn into(self) -> Bytes { - self.inner.into() - } -} - /// Almost a full `HeaderName` #[derive(Debug, Hash)] pub struct HdrName<'a> { @@ -51,28 +44,10 @@ enum Repr { Custom(T), } -impl convert::Into for Repr -where T: convert::Into { - fn into(self) -> Bytes { - match self { - Repr::Standard(header) => - Bytes::from_static(header.as_str().as_bytes()), - Repr::Custom(header) => header.into() - } - } -} - // Used to hijack the Hash impl #[derive(Debug, Clone, Eq, PartialEq)] struct Custom(ByteStr); -impl convert::Into for Custom { - #[inline] - fn into(self) -> Bytes { - self.0.into() - } -} - #[derive(Debug, Clone)] struct MaybeLower<'a> { buf: &'a [u8], @@ -1538,6 +1513,33 @@ impl<'a> From<&'a HeaderName> for HeaderName { } } +#[doc(hidden)] +impl Into for Repr +where T: Into { + fn into(self) -> Bytes { + match self { + Repr::Standard(header) => + Bytes::from_static(header.as_str().as_bytes()), + Repr::Custom(header) => header.into() + } + } +} + +impl Into for Custom { + #[inline] + fn into(self) -> Bytes { + self.0.into() + } +} + +impl Into for HeaderName { + #[inline] + fn into(self) -> Bytes { + self.inner.into() + } +} + + #[doc(hidden)] impl From for HeaderName { fn from(src: StandardHeader) -> HeaderName {