diff --git a/README.md b/README.md index 880fa2e..030f2b2 100644 --- a/README.md +++ b/README.md @@ -50,11 +50,11 @@ MagickWand has some global state that needs to be initialized prior to using the ```rust use magick_rust::{MagickWand, magick_wand_genesis}; -use std::sync::{Once, ONCE_INIT}; +use std::sync::Once; // Used to make sure MagickWand is initialized exactly once. Note that we // do not bother shutting down, we simply exit when we're done. -static START: Once = ONCE_INIT; +static START: Once = Once::new(); fn resize() -> Result, &'static str> { START.call_once(|| { diff --git a/tests/lib.rs b/tests/lib.rs index 6541daf..7e459c6 100644 --- a/tests/lib.rs +++ b/tests/lib.rs @@ -23,11 +23,11 @@ use std::error::Error; use std::fs::File; use std::io::Read; use std::path::Path; -use std::sync::{Once, ONCE_INIT}; +use std::sync::Once; // Used to make sure MagickWand is initialized exactly once. Note that we // do not bother shutting down, we simply exit when the tests are done. -static START: Once = ONCE_INIT; +static START: Once = Once::new(); #[test] fn test_new_drop() {