diff options
| author | Owen Jacobson <owen@grimoire.ca> | 2024-09-25 01:22:07 -0400 |
|---|---|---|
| committer | Owen Jacobson <owen@grimoire.ca> | 2024-09-25 02:15:25 -0400 |
| commit | 697e90f291cec1bbd89965c2731f9481ec4507c4 (patch) | |
| tree | b40ef7142da474b0ad2bd370b2c89d2008570976 /src/clock.rs | |
| parent | af7ece7dd5433051d67526ae15ad64f0f5b5e568 (diff) | |
rustdoc comment for the (very limited) public API of the crate.
This silences some `-Wclippy::pedantic` warning, and it's just a good thing to do.
I've made the choice to have the docs comment face programmers, and to provide `hi --help` and `hi -h` content via Clap attributes instead of inferring it from the docs comment.
Internal (private) "rustdoc" comments have been converted to regular comments until I learn how to write better rustdoc.
Diffstat (limited to 'src/clock.rs')
| -rw-r--r-- | src/clock.rs | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/src/clock.rs b/src/clock.rs index d162fc0..81ecede 100644 --- a/src/clock.rs +++ b/src/clock.rs @@ -8,10 +8,10 @@ use chrono::Utc; pub type DateTime = chrono::DateTime<chrono::Utc>; -/// Extractor that provides the "current time" for a request. This time is calculated -/// once per request, even if the extractor is used in multiple places. This requires -/// the [middleware] function to be installed with [axum::middleware::from_fn] around -/// the current route. +// Extractor that provides the "current time" for a request. This time is calculated +// once per request, even if the extractor is used in multiple places. This requires +// the [middleware] function to be installed with [axum::middleware::from_fn] around +// the current route. #[derive(Clone)] pub struct RequestedAt(pub DateTime); @@ -53,8 +53,8 @@ impl std::ops::Deref for RequestedAt { } } -/// Computes a canonical "requested at" time for each request it wraps. This -/// time can be recovered using the [RequestedAt] extractor. +// Computes a canonical "requested at" time for each request it wraps. This +// time can be recovered using the [RequestedAt] extractor. pub async fn middleware(mut req: Request, next: Next) -> Result<Response, StatusCode> { let now = RequestedAt::now(); req.extensions_mut().insert(now); |
