Skip to content

Commit f4871d6

Browse files
committed
Update doc comments
1 parent d36468f commit f4871d6

File tree

2 files changed

+21
-16
lines changed

2 files changed

+21
-16
lines changed

src/auto_vary.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,8 @@ const MIDDLEWARE_DOUBLE_USE: &str =
2929
"Configuration error: `axum_httpx::vary_middleware` is used twice";
3030

3131
/// Addresses [htmx caching issue](https://htmx.org/docs/#caching)
32-
/// by automatically adding a corresponding `Vary` header when [`HxRequest`], [`HxTarget`],
33-
/// [`HxTrigger`], [`HxTriggerName`] or their combination is used.
32+
/// by automatically adding a corresponding `Vary` header when [`HxRequest`],
33+
/// [`HxTarget`], [`HxTrigger`], [`HxTriggerName`] or their combination is used.
3434
#[derive(Clone)]
3535
pub struct AutoVaryLayer;
3636

src/responders/vary.rs

+19-14
Original file line numberDiff line numberDiff line change
@@ -10,13 +10,15 @@ const HX_TRIGGER_NAME: HeaderValue = HeaderValue::from_static(headers::HX_TRIGGE
1010

1111
/// The `Vary: HX-Request` header.
1212
///
13-
/// You may want to add this header to the response if your handler responds differently based on
14-
/// the `HX-Request` request header.
13+
/// You may want to add this header to the response if your handler responds
14+
/// differently based on the `HX-Request` request header.
1515
///
16-
/// For example, if your server renders the full HTML when the `HX-Request` header is missing or
17-
/// `false`, and it renders a fragment of that HTML when `HX-Request: true`.
16+
/// For example, if your server renders the full HTML when the `HX-Request`
17+
/// header is missing or `false`, and it renders a fragment of that HTML when
18+
/// `HX-Request: true`.
1819
///
19-
/// You probably need this only for `GET` requests, as other HTTP methods are not cached by default.
20+
/// You probably need this only for `GET` requests, as other HTTP methods are
21+
/// not cached by default.
2022
///
2123
/// See <https://htmx.org/docs/#caching> for more information.
2224
#[derive(Debug, Clone)]
@@ -41,10 +43,11 @@ impl extractors::HxRequest {
4143

4244
/// The `Vary: HX-Target` header.
4345
///
44-
/// You may want to add this header to the response if your handler responds differently based on
45-
/// the `HX-Target` request header.
46+
/// You may want to add this header to the response if your handler responds
47+
/// differently based on the `HX-Target` request header.
4648
///
47-
/// You probably need this only for `GET` requests, as other HTTP methods are not cached by default.
49+
/// You probably need this only for `GET` requests, as other HTTP methods are
50+
/// not cached by default.
4851
///
4952
/// See <https://htmx.org/docs/#caching> for more information.
5053
#[derive(Debug, Clone)]
@@ -69,10 +72,11 @@ impl extractors::HxTarget {
6972

7073
/// The `Vary: HX-Trigger` header.
7174
///
72-
/// You may want to add this header to the response if your handler responds differently based on
73-
/// the `HX-Trigger` request header.
75+
/// You may want to add this header to the response if your handler responds
76+
/// differently based on the `HX-Trigger` request header.
7477
///
75-
/// You probably need this only for `GET` requests, as other HTTP methods are not cached by default.
78+
/// You probably need this only for `GET` requests, as other HTTP methods are
79+
/// not cached by default.
7680
///
7781
/// See <https://htmx.org/docs/#caching> for more information.
7882
#[derive(Debug, Clone)]
@@ -97,10 +101,11 @@ impl extractors::HxTrigger {
97101

98102
/// The `Vary: HX-Trigger-Name` header.
99103
///
100-
/// You may want to add this header to the response if your handler responds differently based on
101-
/// the `HX-Trigger-Name` request header.
104+
/// You may want to add this header to the response if your handler responds
105+
/// differently based on the `HX-Trigger-Name` request header.
102106
///
103-
/// You probably need this only for `GET` requests, as other HTTP methods are not cached by default.
107+
/// You probably need this only for `GET` requests, as other HTTP methods are
108+
/// not cached by default.
104109
///
105110
/// See <https://htmx.org/docs/#caching> for more information.
106111
#[derive(Debug, Clone)]

0 commit comments

Comments
 (0)