mirror of https://github.com/rwf2/Rocket.git
Use 'hyper' instead of 'http' where possible.
This commit is contained in:
parent
6d2059f9eb
commit
be3ceef4e3
|
@ -11,7 +11,7 @@
|
||||||
pub mod header {
|
pub mod header {
|
||||||
macro_rules! import_http_headers {
|
macro_rules! import_http_headers {
|
||||||
($($name:ident),*) => ($(
|
($($name:ident),*) => ($(
|
||||||
pub use http::header::$name as $name;
|
pub use hyper::header::$name as $name;
|
||||||
)*)
|
)*)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -3,6 +3,8 @@ use std::str::FromStr;
|
||||||
|
|
||||||
use self::Method::*;
|
use self::Method::*;
|
||||||
|
|
||||||
|
use crate::hyper;
|
||||||
|
|
||||||
// TODO: Support non-standard methods, here and in codegen?
|
// TODO: Support non-standard methods, here and in codegen?
|
||||||
|
|
||||||
/// Representation of HTTP methods.
|
/// Representation of HTTP methods.
|
||||||
|
@ -52,17 +54,17 @@ pub enum Method {
|
||||||
impl Method {
|
impl Method {
|
||||||
/// WARNING: This is unstable! Do not use this method outside of Rocket!
|
/// WARNING: This is unstable! Do not use this method outside of Rocket!
|
||||||
#[doc(hidden)]
|
#[doc(hidden)]
|
||||||
pub fn from_hyp(method: &http::method::Method) -> Option<Method> {
|
pub fn from_hyp(method: &hyper::Method) -> Option<Method> {
|
||||||
match *method {
|
match *method {
|
||||||
http::method::Method::GET => Some(Get),
|
hyper::Method::GET => Some(Get),
|
||||||
http::method::Method::PUT => Some(Put),
|
hyper::Method::PUT => Some(Put),
|
||||||
http::method::Method::POST => Some(Post),
|
hyper::Method::POST => Some(Post),
|
||||||
http::method::Method::DELETE => Some(Delete),
|
hyper::Method::DELETE => Some(Delete),
|
||||||
http::method::Method::OPTIONS => Some(Options),
|
hyper::Method::OPTIONS => Some(Options),
|
||||||
http::method::Method::HEAD => Some(Head),
|
hyper::Method::HEAD => Some(Head),
|
||||||
http::method::Method::TRACE => Some(Trace),
|
hyper::Method::TRACE => Some(Trace),
|
||||||
http::method::Method::CONNECT => Some(Connect),
|
hyper::Method::CONNECT => Some(Connect),
|
||||||
http::method::Method::PATCH => Some(Patch),
|
hyper::Method::PATCH => Some(Patch),
|
||||||
_ => None,
|
_ => None,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue