mirror of
https://github.com/actix/actix-website
synced 2025-06-27 07:29:02 +02:00
use actix-web 0.7 for examples
This commit is contained in:
@ -1,7 +1,7 @@
|
||||
[package]
|
||||
name = "application"
|
||||
version = "0.6.0"
|
||||
version = "0.7.0"
|
||||
workspace = "../"
|
||||
|
||||
[dependencies]
|
||||
actix-web = "0.6"
|
||||
actix-web = "0.7"
|
||||
|
@ -7,7 +7,7 @@ mod vh;
|
||||
|
||||
fn make_app() {
|
||||
// <make_app>
|
||||
fn index(req: HttpRequest) -> impl Responder {
|
||||
fn index(req: &HttpRequest) -> impl Responder {
|
||||
"Hello world!"
|
||||
}
|
||||
|
||||
|
@ -7,7 +7,7 @@ struct AppState {
|
||||
counter: Cell<usize>,
|
||||
}
|
||||
|
||||
fn index(req: HttpRequest<AppState>) -> String {
|
||||
fn index(req: &HttpRequest<AppState>) -> String {
|
||||
let count = req.state().counter.get() + 1; // <- get count
|
||||
req.state().counter.set(count); // <- store new count in state
|
||||
|
||||
|
Reference in New Issue
Block a user