From 511ab8ce5159bb21ccf39b74d404242eca900bb5 Mon Sep 17 00:00:00 2001 From: blackjune Date: Sat, 25 May 2019 22:22:43 +0800 Subject: [PATCH] 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() ``` --- state/src/main.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/state/src/main.rs b/state/src/main.rs index 3ebb38a9..a11d5da2 100644 --- a/state/src/main.rs +++ b/state/src/main.rs @@ -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 || {