diff --git a/gotham_restful/src/lib.rs b/gotham_restful/src/lib.rs index cf1ef9c..e8ee7bc 100644 --- a/gotham_restful/src/lib.rs +++ b/gotham_restful/src/lib.rs @@ -108,7 +108,12 @@ extern crate self as gotham_restful; #[macro_use] extern crate serde; #[doc(no_inline)] -pub use gotham::hyper::{header::HeaderName, StatusCode}; +pub use gotham; +#[doc(no_inline)] +pub use gotham::{ + hyper::{header::HeaderName, StatusCode}, + state::{FromState, State} +}; #[doc(no_inline)] pub use mime::Mime; @@ -119,10 +124,6 @@ pub use gotham_restful_derive::*; pub mod export { pub use futures_util::future::FutureExt; - pub use gotham::{ - hyper::body::Bytes, - state::{FromState, State} - }; #[cfg(feature = "database")] pub use gotham_middleware_diesel::Repo; diff --git a/gotham_restful_derive/src/from_body.rs b/gotham_restful_derive/src/from_body.rs index 4884659..4119845 100644 --- a/gotham_restful_derive/src/from_body.rs +++ b/gotham_restful_derive/src/from_body.rs @@ -58,7 +58,7 @@ fn expand(tokens : TokenStream) -> Result { type Err = String; - fn from_body(body : #krate::export::Bytes, _content_type : #krate::Mime) -> Result + fn from_body(body : #krate::gotham::hyper::body::Bytes, _content_type : #krate::Mime) -> Result { let body : &[u8] = &body; Ok(#body) diff --git a/gotham_restful_derive/src/method.rs b/gotham_restful_derive/src/method.rs index a8603b2..2d44ed4 100644 --- a/gotham_restful_derive/src/method.rs +++ b/gotham_restful_derive/src/method.rs @@ -367,7 +367,7 @@ fn expand(method : Method, attrs : TokenStream, item : TokenStream) -> Result = args.iter().map(|arg| match (&arg.ty, &arg.ident) { @@ -447,10 +447,10 @@ fn expand(method : Method, attrs : TokenStream, item : TokenStream) -> Result std::pin::Pin + Send>> + fn #method_ident(#(#args_def),*) -> std::pin::Pin + Send>> { #[allow(unused_imports)] - use #krate::export::{FromState, FutureExt}; + use #krate::{export::FutureExt, FromState}; #state_block