1
0
mirror of https://github.com/actix/actix-website synced 2025-06-29 08:14:58 +02:00

Merge pull request #54 from iyuq/fixed-either

Fixed Either sample code
This commit is contained in:
Nikolay Kim
2018-10-27 04:59:04 -07:00
committed by GitHub

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"))