From 5d76d0712e07040d9aeeebccb189d75636a07c7a Mon Sep 17 00:00:00 2001 From: Owen Jacobson Date: Thu, 12 Sep 2024 00:31:08 -0400 Subject: Consolidate the (now) two definitions of DateTime. --- src/clock.rs | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'src/clock.rs') diff --git a/src/clock.rs b/src/clock.rs index 84fcaf6..7757925 100644 --- a/src/clock.rs +++ b/src/clock.rs @@ -4,14 +4,16 @@ use axum::{ middleware::Next, response::Response, }; -use chrono::{DateTime, Utc}; +use chrono::Utc; + +pub type DateTime = chrono::DateTime; /// 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); +pub struct RequestedAt(pub DateTime); impl RequestedAt { fn now() -> Self { -- cgit v1.2.3