1
0
mirror of https://github.com/actix/actix-website synced 2025-01-22 16:15:56 +01: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
commit 9286357d2d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

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