This commit is contained in:
Akos Vandra 2018-12-09 00:32:07 +01:00
parent 5bbb05ecd2
commit ee02203ba5
1 changed files with 3 additions and 2 deletions

View File

@ -656,6 +656,7 @@ where
/// #[macro_use] extern crate serde_derive;
/// use actix_web::{http, App, Result, HttpRequest, Error, FromRequest};
/// use actix_web::error::ErrorBadRequest;
/// use actix_web::Either;
///
/// #[derive(Debug, Deserialize)]
/// struct Thing { name: String }
@ -694,8 +695,8 @@ where
/// /// extract text data from request
/// fn index(supplied_thing: Either<Thing, OtherThing>) -> Result<String> {
/// match supplied_thing {
/// A(thing) => Ok(format!("Got something: {:?}", thing)),
/// B(other_thing) => Ok(format!("Got anotherthing: {:?}", other_thing))
/// Either::A(thing) => Ok(format!("Got something: {:?}", thing)),
/// Either::B(other_thing) => Ok(format!("Got anotherthing: {:?}", other_thing))
/// }
/// }
///