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