Zero clippy/rustc warnings project-wide
Browse files at this commitc7829873a1568c218bdb9b19060d331e67e9f5ecParent: fae1f79- style
- zero clippy/rustc warnings project-wide
2 changed files +4 -5
- src/web/auth.rs +2 -2
- tests/common/mod.rs +2 -3
src/web/auth.rsmodified+2 -2
| @@ -99,7 +99,7 @@ struct SchoolChoiceResponse { | |||
| 99 | #[derive(Serialize, ToSchema)] | 99 | #[derive(Serialize, ToSchema)] |
| 100 | #[serde(untagged)] | 100 | #[serde(untagged)] |
| 101 | enum LoginResponse { | 101 | enum LoginResponse { |
| 102 | - LoggedIn(UserResponse), | 102 | + LoggedIn(Box<UserResponse>), |
| 103 | ChooseSchool(SchoolChoiceResponse), | 103 | ChooseSchool(SchoolChoiceResponse), |
| 104 | } | 104 | } |
| 105 | 105 | ||
| @@ -296,7 +296,7 @@ async fn login( | |||
| 296 | ); | 296 | ); |
| 297 | Ok(( | 297 | Ok(( |
| 298 | jar.add(cookie), | 298 | jar.add(cookie), |
| 299 | - Json(LoginResponse::LoggedIn(UserResponse::new(&user))), | 299 | + Json(LoginResponse::LoggedIn(Box::new(UserResponse::new(&user)))), |
| 300 | )) | 300 | )) |
| 301 | } | 301 | } |
| 302 | many => { | 302 | many => { |
tests/common/mod.rsmodified+2 -3
| @@ -233,7 +233,7 @@ pub async fn login_as_school( | |||
| 233 | // The account is a person: if `username` already belongs to another | 233 | // The account is a person: if `username` already belongs to another |
| 234 | // school, login answers a choice list and never names a school — bind | 234 | // school, login answers a choice list and never names a school — bind |
| 235 | // the school this helper was called for. | 235 | // the school this helper was called for. |
| 236 | - let cookie = if res.body["schools"].is_array() { | 236 | + if res.body["schools"].is_array() { |
| 237 | let selected = send( | 237 | let selected = send( |
| 238 | app, | 238 | app, |
| 239 | "POST", | 239 | "POST", |
| @@ -251,8 +251,7 @@ pub async fn login_as_school( | |||
| 251 | selected.cookie.expect("school cookie after selection") | 251 | selected.cookie.expect("school cookie after selection") |
| 252 | } else { | 252 | } else { |
| 253 | res.cookie.expect("session cookie set on login") | 253 | res.cookie.expect("session cookie set on login") |
| 254 | - }; | 254 | + } |
| 255 | - cookie | ||
| 256 | } | 255 | } |
| 257 | 256 | ||
| 258 | /// Send one request through `app`. `cookie` is a raw `Cookie` header value. | 257 | /// Send one request through `app`. `cookie` is a raw `Cookie` header value. |