From a17ff492a1840535e36ae048a455a19e748b9f34 Mon Sep 17 00:00:00 2001 From: Nikolay Kim Date: Sat, 4 May 2019 22:18:59 -0700 Subject: [PATCH] fix formatting --- MIGRATION.md | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/MIGRATION.md b/MIGRATION.md index a07a6508..73669ddb 100644 --- a/MIGRATION.md +++ b/MIGRATION.md @@ -97,7 +97,7 @@ instead of ```rust -fn index(req: &HttpRequest) -> Box> { + fn index(req: &HttpRequest) -> Box> { req .payload() .from_err() @@ -106,21 +106,21 @@ fn index(req: &HttpRequest) -> Box> { }) .map(|_| HttpResponse::Ok().finish()) .responder() -} - ``` + } + ``` - use `Payload` extractor + use `Payload` extractor ```rust -fn index(stream: web::Payload) -> impl Future { - stream + fn index(stream: web::Payload) -> impl Future { + stream .from_err() .fold((), |_, chunk| { ... }) .map(|_| HttpResponse::Ok().finish()) -} - ``` + } + ``` * `State` is now `Data`. You register Data during the App initialization process and then access it from handlers either using a Data extractor or using