1
0
mirror of https://github.com/matrix-org/matrix-authentication-service.git synced 2025-12-06 22:40:58 +03:00

Convert many match/if expressions to let-else

This commit is contained in:
Quentin Gliech
2023-02-01 10:15:35 +01:00
parent d9649975b9
commit 792d3c793b
22 changed files with 51 additions and 107 deletions

View File

@@ -28,14 +28,8 @@ where
}
pub fn http_all_error_status_codes() -> impl RangeBounds<StatusCode> {
let client_errors_start_code = match StatusCode::from_u16(400) {
Ok(code) => code,
Err(_) => unreachable!(),
};
let server_errors_end_code = match StatusCode::from_u16(599) {
Ok(code) => code,
Err(_) => unreachable!(),
};
let Ok(client_errors_start_code) = StatusCode::from_u16(400) else { unreachable!() };
let Ok(server_errors_end_code) = StatusCode::from_u16(599) else { unreachable!() };
client_errors_start_code..=server_errors_end_code
}