From 9ed8fe487f6fe43194d2f215ca91bfb19c825212 Mon Sep 17 00:00:00 2001 From: Harold Miao Date: Fri, 2 Feb 2024 20:32:39 +0800 Subject: [PATCH] Update global-variable.md --- src/advance/global-variable.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/advance/global-variable.md b/src/advance/global-variable.md index 80d8c47e..da8b742a 100644 --- a/src/advance/global-variable.md +++ b/src/advance/global-variable.md @@ -93,7 +93,7 @@ fn generate_id()->usize{ if current_val > MAX_ID{ panic!("Factory ids overflowed"); } - GLOBAL_ID_COUNTER.fetch_add(1, Ordering::Relaxed) + GLOBAL_ID_COUNTER.fetch_add(1, Ordering::Relaxed); let next_id = GLOBAL_ID_COUNTER.load(Ordering::Relaxed); if next_id > MAX_ID{ panic!("Factory ids overflowed");