Skip to content

Commit db195ef

Browse files
committed
style(redirect): fmt code
1 parent 66368be commit db195ef

2 files changed

Lines changed: 5 additions & 9 deletions

File tree

src/client/response.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -119,9 +119,9 @@ impl Response {
119119
pub fn history(&self) -> impl Iterator<Item = &History> {
120120
self.res
121121
.extensions()
122-
.get::<redirect::RedirectHistory>()
123-
.map(|h| h.0.iter())
124-
.unwrap_or_else(|| [].iter())
122+
.get::<redirect::RedirectEntries>()
123+
.map(|entries| entries.0.iter())
124+
.unwrap_or_default()
125125
}
126126

127127
/// Returns a reference to the associated extensions.

src/redirect.rs

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ pub struct History {
6161

6262
/// A list of redirect history entries.
6363
#[derive(Clone, Debug)]
64-
pub(crate) struct RedirectHistory(pub Vec<History>);
64+
pub(crate) struct RedirectEntries(pub Vec<History>);
6565

6666
// ===== impl Policy =====
6767

@@ -240,25 +240,21 @@ impl<'a> Attempt<'a> {
240240

241241
impl History {
242242
/// Get the status code of the redirect response.
243-
#[inline(always)]
244243
pub fn status(&self) -> StatusCode {
245244
self.status
246245
}
247246

248247
/// Get the URI of the redirect response.
249-
#[inline(always)]
250248
pub fn uri(&self) -> &Uri {
251249
&self.uri
252250
}
253251

254252
/// Get the previous URI before the redirect response.
255-
#[inline(always)]
256253
pub fn previous(&self) -> &Uri {
257254
&self.previous
258255
}
259256

260257
/// Get the headers of the redirect response.
261-
#[inline(always)]
262258
pub fn headers(&self) -> &HeaderMap {
263259
&self.headers
264260
}
@@ -431,7 +427,7 @@ impl policy::Policy<Body, BoxError> for FollowRedirectPolicy {
431427
if let Some(history_entries) = self.history_entries.take() {
432428
response
433429
.extensions_mut()
434-
.insert(RedirectHistory(history_entries));
430+
.insert(RedirectEntries(history_entries));
435431
}
436432
}
437433
}

0 commit comments

Comments
 (0)