Stop exporting 'mime' and relevant conversions.

This commit is contained in:
Sergio Benitez 2019-09-09 16:42:44 -07:00
parent c5973f01df
commit 6ed4c098f1
2 changed files with 1 additions and 26 deletions

View File

@ -1,4 +1,4 @@
use std::borrow::{Borrow, Cow};
use std::borrow::Cow;
use std::ops::Deref;
use std::str::FromStr;
use std::fmt;
@ -6,7 +6,6 @@ use std::fmt;
use crate::header::Header;
use crate::media_type::{MediaType, Source};
use crate::ext::IntoCollection;
use crate::hyper::mime::Mime;
/// Representation of HTTP Content-Types.
///
@ -267,28 +266,6 @@ impl Deref for ContentType {
}
}
#[doc(hidden)]
impl<T: Borrow<Mime>> From<T> for ContentType {
#[inline(always)]
default fn from(mime: T) -> ContentType {
let mime: Mime = mime.borrow().clone();
ContentType::from(mime)
}
}
#[doc(hidden)]
impl From<Mime> for ContentType {
#[inline]
fn from(mime: Mime) -> ContentType {
// soooo inefficient.
let params = mime.2.into_iter()
.map(|(attr, value)| (attr.to_string(), value.to_string()))
.collect::<Vec<_>>();
ContentType::with_params(mime.0.to_string(), mime.1.to_string(), params)
}
}
impl FromStr for ContentType {
type Err = String;

View File

@ -18,8 +18,6 @@
#[doc(hidden)] pub use hyper::http::h1;
#[doc(hidden)] pub use hyper::buffer;
pub use hyper::mime;
/// Type alias to `hyper::Response<'a, hyper::net::Fresh>`.
#[doc(hidden)] pub type FreshResponse<'a> = self::Response<'a, self::net::Fresh>;