Skip to content

Commit

Permalink
Formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
benwis committed Sep 28, 2023
1 parent 2b08f1b commit cb90afb
Showing 1 changed file with 11 additions and 6 deletions.
17 changes: 11 additions & 6 deletions integrations/axum/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
use axum::{
body::{Body, Bytes, Full, StreamBody},
extract::{FromRef, FromRequestParts, Path, RawQuery, MatchedPath},
extract::{FromRef, FromRequestParts, MatchedPath, Path, RawQuery},
http::{
header::{HeaderName, HeaderValue},
HeaderMap, Request, StatusCode,
Expand Down Expand Up @@ -645,15 +645,20 @@ where

move |req| {
// 1. Process route to match the values in routeListing
let path = req.extensions().get::<MatchedPath>().expect("Failed to get Axum router rule").as_str();
let path = req
.extensions()
.get::<MatchedPath>()
.expect("Failed to get Axum router rule")
.as_str();
// 2. Find RouteListing in paths. This should probably be optimized, we probably don't want to
// search for this every time
let listing: &RouteListing =
paths.iter().find(|r| r.path() == path).expect(
&format!("Failed to find the route {} requested by the user. This \
paths.iter().find(|r| r.path() == path).expect(&format!(
"Failed to find the route {} requested by the user. This \
suggests that the routing rules in the Router that call this \
handler needs to be edited!", path)
);
handler needs to be edited!",
path
));
// 3. Match listing mode against known, and choose function
match listing.mode() {
SsrMode::OutOfOrder => ooo(req),
Expand Down

0 comments on commit cb90afb

Please sign in to comment.