1
0
mirror of https://github.com/actix/examples synced 2025-06-28 09:50:36 +02:00

Fix bug in state type

Fix bug in state type 
```rust
let counter = Arc::new(Mutex::new(0));
```
may not be usize

Error before this change:
```
App data is not configured, to configure use App::data()
```
This commit is contained in:
blackjune
2019-05-25 22:22:43 +08:00
committed by GitHub
parent eff911db89
commit 511ab8ce51

View File

@ -28,7 +28,7 @@ fn main() -> io::Result<()> {
std::env::set_var("RUST_LOG", "actix_web=info");
env_logger::init();
let counter = Arc::new(Mutex::new(0));
let counter = Arc::new(Mutex::new(0usize));
//move is necessary to give closure below ownership of counter
HttpServer::new(move || {