1
0
mirror of https://github.com/actix/actix-website synced 2025-02-17 10:13:31 +01:00

Fixed Either sample code

This commit is contained in:
Qi Yu 2018-10-27 07:24:47 +08:00
parent bfff012b6a
commit 53d491e4a6

View File

@ -278,7 +278,7 @@ use actix_web::{Either, Error, HttpResponse};
type RegisterResult = Either<HttpResponse, Box<Future<Item=HttpResponse, Error=Error>>>;
fn index(req: &HttpRequest) -> impl Responder {
fn index(req: &HttpRequest) -> RegisterResult {
if is_a_variant() { // <- choose variant A
Either::A(
HttpResponse::BadRequest().body("Bad data"))