How can I set the HTTP status code of a (Rust) Rocket API endpoint's Template response?
问题 I have the following login POST endpoint handler in my Rocket API: #[post("/login", data = "<login_form>")] pub fn login_validate(login_form: Form<LoginForm>) -> Result<Redirect, Template> { let user = get_user(&login_form.username).unwrap(); match user { Some(existing_user) => if verify(&login_form.password, &existing_user.password_hash).unwrap() { return Ok(Redirect::to(uri!(home))) }, // we now hash (without verifying) just to ensure that the timing is the same None => { hash(&login_form