diff --git a/crates/http/src/utils.rs b/crates/http/src/utils.rs index 315ab82..c91d834 100644 --- a/crates/http/src/utils.rs +++ b/crates/http/src/utils.rs @@ -14,10 +14,6 @@ /// * `$predicate` - A boolean expression that should evaluate to true /// * `$error` - The error value to return if the predicate is false /// -/// # Example -/// -/// ``` -/// ensure!(headers.len() < MAX_HEADERS, ParseError::TooManyHeaders); /// ``` macro_rules! ensure { ($predicate:expr, $error:expr) => { diff --git a/crates/web/src/fn_trait.rs b/crates/web/src/fn_trait.rs index ce43263..e5ad0f0 100644 --- a/crates/web/src/fn_trait.rs +++ b/crates/web/src/fn_trait.rs @@ -8,9 +8,7 @@ //! //! # Examples //! -//! ```rust -//! use micro_web::fn_trait::FnTrait; -//! +//! ```no_run //! // Handler with no parameters //! async fn handler0() -> &'static str { //! "Hello World!" @@ -46,15 +44,16 @@ use std::future::Future; /// # Examples /// /// ```rust -/// use micro_web::fn_trait::FnTrait; -/// use http::Method; +/// use http::Method;/// +/// +/// use micro_web::FnTrait; /// /// async fn my_handler(method: &Method) -> String { /// format!("Handling {} request", method) /// } /// /// // The function automatically implements FnTrait -/// fn assert_handler>(f: F) {} +/// fn assert_handler<'r, F: FnTrait<(&'r Method,)>>(f: F) {} /// assert_handler(my_handler); /// ``` pub trait FnTrait: Send + Sync { @@ -75,8 +74,10 @@ pub trait FnTrait: Send + Sync { /// /// # Example Generated Implementation /// -/// ```rust +/// ```ignore /// // For a two-parameter function: +/// use micro_web::FnTrait; +/// /// impl FnTrait<(A, B)> for Func /// where /// Func: Fn(A, B) -> Fut + Send + Sync,