Skip to content

Commit 1f6700c

Browse files
authored
conduit-axum: Remove StartInstant extension (#5799)
We're not using this anywhere anymore and `conduit` does not appear to use it internally either.
1 parent da8a91c commit 1f6700c

File tree

2 files changed

+5
-8
lines changed

2 files changed

+5
-8
lines changed

conduit-axum/src/adaptor.rs

+3-5
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
use std::io::{Cursor, Read};
1313
use std::net::SocketAddr;
1414

15-
use conduit::{Host, RequestExt, Scheme, StartInstant};
15+
use conduit::{Host, RequestExt, Scheme};
1616
use http::request::Parts as HttpParts;
1717
use http::{Extensions, HeaderMap, Method, Request, Version};
1818
use hyper::body::Bytes;
@@ -24,15 +24,13 @@ pub(crate) struct ConduitRequest {
2424
}
2525

2626
impl ConduitRequest {
27-
pub(crate) fn new(request: Request<Bytes>, now: StartInstant) -> Self {
28-
let (mut parts, body) = request.into_parts();
27+
pub(crate) fn new(request: Request<Bytes>) -> Self {
28+
let (parts, body) = request.into_parts();
2929
let path = parts.uri.path().as_bytes();
3030
let path = percent_encoding::percent_decode(path)
3131
.decode_utf8_lossy()
3232
.into_owned();
3333

34-
parts.extensions.insert(now);
35-
3634
Self {
3735
parts,
3836
path,

conduit-axum/src/fallback.rs

+2-3
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ use axum::body::{Body, HttpBody};
1212
use axum::extract::Extension;
1313
use axum::handler::Handler as AxumHandler;
1414
use axum::response::IntoResponse;
15-
use conduit::{Handler, RequestExt, StartInstant};
15+
use conduit::{Handler, RequestExt};
1616
use conduit_router::RoutePattern;
1717
use http::header::CONTENT_LENGTH;
1818
use http::StatusCode;
@@ -64,7 +64,6 @@ where
6464
}
6565

6666
let (parts, body) = request.into_parts();
67-
let now = StartInstant::now();
6867

6968
let full_body = match hyper::body::to_bytes(body).await {
7069
Ok(body) => body,
@@ -74,7 +73,7 @@ where
7473

7574
let Self(handler) = self;
7675
spawn_blocking(move || {
77-
let mut request = ConduitRequest::new(request, now);
76+
let mut request = ConduitRequest::new(request);
7877
handler
7978
.call(&mut request)
8079
.map(|mut response| {

0 commit comments

Comments
 (0)