mirror of
https://github.com/tokio-rs/axum.git
synced 2026-08-28 00:00:20 +02:00
style: use Self to avoid unnecessary repetition (#3396)
This commit is contained in:
@@ -321,13 +321,13 @@ mod tests {
|
||||
}
|
||||
|
||||
impl FromRef<AppState> for Key {
|
||||
fn from_ref(state: &AppState) -> Key {
|
||||
fn from_ref(state: &AppState) -> Self {
|
||||
state.key.clone()
|
||||
}
|
||||
}
|
||||
|
||||
impl FromRef<AppState> for CustomKey {
|
||||
fn from_ref(state: &AppState) -> CustomKey {
|
||||
fn from_ref(state: &AppState) -> Self {
|
||||
state.custom_key.clone()
|
||||
}
|
||||
}
|
||||
|
||||
@@ -136,7 +136,7 @@ where
|
||||
key,
|
||||
_marker: _,
|
||||
} = PrivateCookieJar::from_headers(&parts.headers, key);
|
||||
Ok(PrivateCookieJar {
|
||||
Ok(Self {
|
||||
jar,
|
||||
key,
|
||||
_marker: PhantomData,
|
||||
|
||||
@@ -153,7 +153,7 @@ where
|
||||
key,
|
||||
_marker: _,
|
||||
} = SignedCookieJar::from_headers(&parts.headers, key);
|
||||
Ok(SignedCookieJar {
|
||||
Ok(Self {
|
||||
jar,
|
||||
key,
|
||||
_marker: PhantomData,
|
||||
|
||||
Reference in New Issue
Block a user