diff --git a/gotham/src/state/data.rs b/gotham/src/state/data.rs index 4c125fc6..0796ed4c 100644 --- a/gotham/src/state/data.rs +++ b/gotham/src/state/data.rs @@ -12,16 +12,12 @@ pub use gotham_derive::StateData; /// A marker trait for types that can be stored in `State`. /// -/// This is typically implemented using `#[derive(StateData)]`, which is provided by the -/// `gotham_derive` crate. +/// This is typically implemented using `#[derive(StateData)]`. /// /// ```rust -/// # extern crate gotham; -/// # #[macro_use] -/// # extern crate gotham_derive; -/// # /// # use gotham::state::{FromState, State}; -/// # +/// use gotham::state::StateData; +/// /// #[derive(StateData)] /// struct MyStateData { /// x: u32, diff --git a/gotham/src/state/mod.rs b/gotham/src/state/mod.rs index db184a8f..deb9ff26 100644 --- a/gotham/src/state/mod.rs +++ b/gotham/src/state/mod.rs @@ -47,23 +47,18 @@ impl Hasher for IdHasher { } /// Provides storage for request state, and stores one item of each type. The types used for -/// storage must implement the `gotham::state::StateData` trait to allow its storage. The -/// `gotham_derive` crate provides a custom derive for `StateData` to make this more convenient. +/// storage must implement the [`StateData`] trait to allow its storage, which is usually done +/// by adding `#[derive(StateData)]` on the type in question. /// /// # Examples /// /// ```rust -/// extern crate gotham; -/// #[macro_use] -/// extern crate gotham_derive; -/// -/// use gotham::state::State; +/// use gotham::state::{State, StateData}; /// /// #[derive(StateData)] /// struct MyStruct { /// value: i32, /// } -/// /// # fn main() { /// # State::with_new(|state| { /// # diff --git a/gotham_derive/src/lib.rs b/gotham_derive/src/lib.rs index d8f535f7..3ef86a0f 100644 --- a/gotham_derive/src/lib.rs +++ b/gotham_derive/src/lib.rs @@ -1,3 +1,6 @@ +//! This crate is a private implementation detail of `gotham`. You should never have to +//! use this crate directly. + mod extenders; mod new_middleware; mod state; diff --git a/middleware/template/src/lib.rs b/middleware/template/src/lib.rs index 27ac254f..a8a2d5c5 100644 --- a/middleware/template/src/lib.rs +++ b/middleware/template/src/lib.rs @@ -9,10 +9,6 @@ #[macro_use] extern crate log; -// Enable to use #[derive(StateData)] below -//#[macro_use] -//extern crate gotham_derive; - use std::pin::Pin; use futures_util::future::{self, FutureExt, TryFutureExt};