1
0
mirror of https://github.com/actix/actix-website synced 2025-06-27 07:29:02 +02:00

Front page examples return 'impl Responder'

This commit is contained in:
Cameron Dershem
2019-06-16 23:37:14 -04:00
parent f922e8fb96
commit 3f95205696
5 changed files with 24 additions and 30 deletions

View File

@ -1,12 +1,12 @@
// <request-routing>
use actix_web::{web, App, HttpRequest, HttpResponse, HttpServer};
use actix_web::{web, App, HttpRequest, HttpServer, Responder};
fn index(_req: HttpRequest) -> HttpResponse {
HttpResponse::Ok().body("Hello from the index page.")
fn index(_req: HttpRequest) -> impl Responder {
"Hello from the index page."
}
fn hello(path: web::Path<String>) -> HttpResponse {
HttpResponse::Ok().body(format!("Hello {}!", &path))
fn hello(path: web::Path<String>) -> impl Responder {
format!("Hello {}!", &path)
}
fn main() {