once_cell in std from 1.70 (#14402)

* once_cell now stable

* cargo fmt

---------

Co-authored-by: parity-processbot <>
This commit is contained in:
Squirrel
2023-06-24 07:45:28 +01:00
committed by GitHub
parent be7c654c42
commit 0750b03300
8 changed files with 8 additions and 18 deletions
@@ -39,7 +39,6 @@ sp-wasm-interface = { version = "14.0.0", path = "../../../primitives/wasm-inter
# this doesn't have any actual benefits for us besides making it harder to debug memory
# problems (since then `mmap` etc. cannot be easily hooked into).
rustix = { version = "0.36.7", default-features = false, features = ["std", "mm", "fs", "param", "use-libc"] }
once_cell = "1.12.0"
[dev-dependencies]
wat = "1.0"
@@ -144,8 +144,8 @@ pub(crate) fn replace_strategy_if_broken(strategy: &mut InstantiationStrategy) {
InstantiationStrategy::LegacyInstanceReuse => InstantiationStrategy::RecreateInstance,
};
use once_cell::sync::OnceCell;
static IS_OK: OnceCell<bool> = OnceCell::new();
use std::sync::OnceLock;
static IS_OK: OnceLock<bool> = OnceLock::new();
let is_ok = IS_OK.get_or_init(|| {
let is_ok = match is_madvise_working() {
-1
View File
@@ -19,7 +19,6 @@ chrono = "0.4.19"
lazy_static = "1.4.0"
libc = "0.2.121"
log = { version = "0.4.17" }
once_cell = "1.8.0"
parking_lot = "0.12.1"
regex = "1.6.0"
rustc-hash = "1.1.0"
@@ -14,18 +14,18 @@
// You should have received a copy of the GNU General Public License
// along with Substrate. If not, see <http://www.gnu.org/licenses/>.
use once_cell::sync::OnceCell;
use parking_lot::Mutex;
use std::sync::OnceLock;
use tracing_subscriber::{
filter::Directive, fmt as tracing_fmt, layer, reload::Handle, EnvFilter, Registry,
};
// Handle to reload the tracing log filter
static FILTER_RELOAD_HANDLE: OnceCell<Handle<EnvFilter, SCSubscriber>> = OnceCell::new();
static FILTER_RELOAD_HANDLE: OnceLock<Handle<EnvFilter, SCSubscriber>> = OnceLock::new();
// Directives that are defaulted to when resetting the log filter
static DEFAULT_DIRECTIVES: OnceCell<Mutex<Vec<String>>> = OnceCell::new();
static DEFAULT_DIRECTIVES: OnceLock<Mutex<Vec<String>>> = OnceLock::new();
// Current state of log filter
static CURRENT_DIRECTIVES: OnceCell<Mutex<Vec<String>>> = OnceCell::new();
static CURRENT_DIRECTIVES: OnceLock<Mutex<Vec<String>>> = OnceLock::new();
/// Add log filter directive(s) to the defaults
///