1
0
mirror of https://github.com/actix/actix-extras.git synced 2025-06-25 01:51:23 +02:00

add status code helper method for http response

This commit is contained in:
Nikolay Kim
2017-11-28 14:23:42 -08:00
parent 706e2a07de
commit 932e751240
4 changed files with 54 additions and 5 deletions

View File

@ -33,8 +33,8 @@ and returns a `HttpResponse` instance or actor that uses `HttpContext` as an act
extern crate actix_web;
use actix_web::prelude::*;
fn index(req: HttpRequest) -> Result<HttpResponse> {
Ok(httpcodes::HTTPOk.with_body("Hello world!"))
fn index(req: HttpRequest) -> &'static str {
"Hello world!"
}
```