Skip to content

Commit 368288e

Browse files
committed
rwf2#1067: Fix whitespace
1 parent 0f7c075 commit 368288e

File tree

1 file changed

+10
-7
lines changed

1 file changed

+10
-7
lines changed

core/lib/src/request/from_request_headers.rs

+10-7
Original file line numberDiff line numberDiff line change
@@ -11,16 +11,18 @@ macro_rules! typed_headers_from_request {
1111
#[rocket::async_trait]
1212
impl<'r> FromRequest<'r> for $name {
1313
type Error = headers::Error;
14-
async fn from_request(req: &'r Request<'_>) -> crate::request::Outcome<Self, Self::Error> {
14+
async fn from_request(req: &'r Request<'_>) ->
15+
crate::request::Outcome<Self, Self::Error> {
1516
req.headers().get($name::name().as_str()).next().or_forward(Status::NotFound)
1617
.and_then(|h| HHeaderValue::from_str(h).or_error(Status::BadRequest))
1718
.map_error(|(s, _)| (s, headers::Error::invalid()))
18-
.and_then(|h| $name::decode(&mut std::iter::once(&h)).or_forward(Status::BadRequest))
19+
.and_then(|h| $name::decode(&mut std::iter::once(&h))
20+
.or_forward(Status::BadRequest))
1921
}
2022
}
2123
)*)
2224
}
23-
25+
2426
macro_rules! generic_typed_headers_from_request {
2527
($($name:ident<$bound:ident>),*) => ($(
2628
pub use crate::http::$name;
@@ -29,15 +31,17 @@ macro_rules! generic_typed_headers_from_request {
2931
impl<'r, T1: 'static + $bound> FromRequest<'r> for $name<T1> {
3032
type Error = headers::Error;
3133
async fn from_request(req: &'r Request<'_>) -> crate::request::Outcome<Self, Self::Error> {
32-
req.headers().get($name::<T1>::name().as_str()).next().or_forward(Status::NotFound)
34+
req.headers().get($name::<T1>::name().as_str()).next()
35+
.or_forward(Status::NotFound)
3336
.and_then(|h| HHeaderValue::from_str(h).or_error(Status::BadRequest))
3437
.map_error(|(s, _)| (s, headers::Error::invalid()))
35-
.and_then(|h| $name::decode(&mut std::iter::once(&h)).or_forward(Status::BadRequest))
38+
.and_then(|h| $name::decode(&mut std::iter::once(&h))
39+
.or_forward(Status::BadRequest))
3640
}
3741
}
3842
)*)
3943
}
40-
44+
4145
// The following headers from 'headers' 0.4 are not imported, since they are
4246
// provided by other Rocket features.
4347

@@ -100,4 +104,3 @@ generic_typed_headers_from_request! {
100104
Authorization<Credentials>, // Authorization header, defined in RFC7235
101105
ProxyAuthorization<Credentials> // Proxy-Authorization header, defined in RFC7235
102106
}
103-

0 commit comments

Comments
 (0)