From cb0fa880c60b228664692491422ab643d1971404 Mon Sep 17 00:00:00 2001 From: Rustln Date: Wed, 6 Apr 2022 14:59:18 +0800 Subject: [PATCH] Fixed deprecated code: `ONCE_INIT`->`Once::new()` --- src/advance/concurrency-with-threads/thread.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/advance/concurrency-with-threads/thread.md b/src/advance/concurrency-with-threads/thread.md index 7b9d37b6..b8c8910e 100644 --- a/src/advance/concurrency-with-threads/thread.md +++ b/src/advance/concurrency-with-threads/thread.md @@ -475,10 +475,10 @@ fn main() { ```rust use std::thread; -use std::sync::{Once, ONCE_INIT}; +use std::sync::Once; static mut VAL: usize = 0; -static INIT: Once = ONCE_INIT; +static INIT: Once = Once::new(); fn main() { let handle1 = thread::spawn(move || {