1
0
mirror of https://github.com/fafhrd91/actix-web synced 2025-07-02 17:24:39 +02:00

Merge pull request #72 from rbtcollins/patch-2

Use AtomicUsize properly
This commit is contained in:
Nikolay Kim
2018-02-12 17:46:03 -08:00
committed by GitHub

View File

@ -89,8 +89,7 @@ impl<S> Handler<S> for MyHandler {
/// Handle request /// Handle request
fn handle(&mut self, req: HttpRequest<S>) -> Self::Result { fn handle(&mut self, req: HttpRequest<S>) -> Self::Result {
let num = self.0.load(Ordering::Relaxed) + 1; self.0.fetch_add(1, Ordering::Relaxed);
self.0.store(num, Ordering::Relaxed);
httpcodes::HTTPOk.into() httpcodes::HTTPOk.into()
} }
} }