style: use Self to avoid unnecessary repetition (#3396)

This commit is contained in:
Theodore Bjernhed
2025-07-04 21:10:01 +00:00
committed by GitHub
parent b8d9a3e764
commit 0f255c3c4c
33 changed files with 137 additions and 138 deletions
+2 -2
View File
@@ -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()
}
}
+1 -1
View File
@@ -136,7 +136,7 @@ where
key,
_marker: _,
} = PrivateCookieJar::from_headers(&parts.headers, key);
Ok(PrivateCookieJar {
Ok(Self {
jar,
key,
_marker: PhantomData,
+1 -1
View File
@@ -153,7 +153,7 @@ where
key,
_marker: _,
} = SignedCookieJar::from_headers(&parts.headers, key);
Ok(SignedCookieJar {
Ok(Self {
jar,
key,
_marker: PhantomData,