1
0
mirror of https://github.com/fafhrd91/actix-web synced 2025-09-01 01:16:59 +02:00

simplify http response construction; deprecate httpcodes

This commit is contained in:
Nikolay Kim
2018-03-30 23:07:33 -07:00
parent 8d8f6bedad
commit 44e3df82f6
58 changed files with 561 additions and 539 deletions

View File

@@ -125,7 +125,7 @@ pub trait HttpMessage {
/// .from_err()
/// .and_then(|bytes: Bytes| { // <- complete body
/// println!("==== BODY ==== {:?}", bytes);
/// Ok(httpcodes::HttpOk.into())
/// Ok(HttpResponse::Ok().into())
/// }).responder()
/// }
/// # fn main() {}
@@ -159,7 +159,7 @@ pub trait HttpMessage {
/// .from_err()
/// .and_then(|params| { // <- url encoded parameters
/// println!("==== BODY ==== {:?}", params);
/// Ok(httpcodes::HttpOk.into())
/// Ok(HttpResponse::Ok().into())
/// })
/// .responder()
/// }
@@ -198,7 +198,7 @@ pub trait HttpMessage {
/// .from_err()
/// .and_then(|val: MyObj| { // <- deserialized value
/// println!("==== BODY ==== {:?}", val);
/// Ok(httpcodes::HttpOk.into())
/// Ok(HttpResponse::Ok().into())
/// }).responder()
/// }
/// # fn main() {}
@@ -240,7 +240,7 @@ pub trait HttpMessage {
/// }
/// })
/// .finish() // <- Stream::finish() combinator from actix
/// .map(|_| httpcodes::HttpOk.into())
/// .map(|_| HttpResponse::Ok().into())
/// .responder()
/// }
/// # fn main() {}