From d36468f9d58fa6d4e16f6daa38eadd48a9cee9ac Mon Sep 17 00:00:00 2001 From: Rob Wagner Date: Mon, 24 Jun 2024 18:11:00 -0400 Subject: [PATCH] Update doc comments --- examples/auto-vary.rs | 6 +++--- src/auto_vary.rs | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/examples/auto-vary.rs b/examples/auto-vary.rs index b7868d5..de4211a 100644 --- a/examples/auto-vary.rs +++ b/examples/auto-vary.rs @@ -19,16 +19,16 @@ async fn main() { serve(listener, app).await.unwrap(); } -// Our handler differentiates full-page GET requests from HTMx-based ones by looking at the `hx-request` +// Our handler differentiates full-page GET requests from htmx-based ones by looking at the `hx-request` // requestheader. // // The middleware sees the usage of the `HxRequest` extractor and automatically adds the // `Vary: hx-request` response header. async fn handler(HxRequest(hx_request): HxRequest) -> Html<&'static str> { if hx_request { - // For HTMx-based GET request, it returns a partial page update + // For htmx-based GET request, it returns a partial page update sleep(Duration::from_secs(3)).await; - return Html("HTMx response"); + return Html("htmx response"); } // While for a normal GET request, it returns the whole page Html( diff --git a/src/auto_vary.rs b/src/auto_vary.rs index c8c0729..ed1b9bf 100644 --- a/src/auto_vary.rs +++ b/src/auto_vary.rs @@ -1,5 +1,5 @@ //! A middleware to automatically add a `Vary` header when needed to address -//! [HTMx caching issue](https://htmx.org/docs/#caching) +//! [htmx caching issue](https://htmx.org/docs/#caching) use std::{ sync::Arc, @@ -28,7 +28,7 @@ use crate::{HxRequest, HxTarget, HxTrigger, HxTriggerName}; const MIDDLEWARE_DOUBLE_USE: &str = "Configuration error: `axum_httpx::vary_middleware` is used twice"; -/// Addresses [HTMx caching issue](https://htmx.org/docs/#caching) +/// Addresses [htmx caching issue](https://htmx.org/docs/#caching) /// by automatically adding a corresponding `Vary` header when [`HxRequest`], [`HxTarget`], /// [`HxTrigger`], [`HxTriggerName`] or their combination is used. #[derive(Clone)]