Skip to content

Commit

Permalink
Use std::sync::OnceLock instead of once_cell.
Browse files Browse the repository at this point in the history
  • Loading branch information
briansmith committed Jun 18, 2024
1 parent 9e1b017 commit 230e895
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 6 deletions.
3 changes: 0 additions & 3 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,6 @@ wasi = { version = "0.11", default-features = false }
[target.'cfg(all(windows, not(target_vendor = "win7")))'.dependencies]
windows-targets = "0.52"

[target.'cfg(any(target_os = "aix", target_os = "android", target_os = "haiku", target_os = "linux", target_os = "nto", target_os = "redox"))'.dependencies]
once_cell = { version = "1.19.0", default-features = false, features = ["std"]}

[target.'cfg(all(any(target_arch = "wasm32", target_arch = "wasm64"), target_os = "unknown"))'.dependencies]
wasm-bindgen = { version = "0.2.62", default-features = false, optional = true }
js-sys = { version = "0.3", optional = true }
Expand Down
1 change: 1 addition & 0 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -205,6 +205,7 @@
html_favicon_url = "https://www.rust-lang.org/favicon.ico",
html_root_url = "https://docs.rs/getrandom/0.2.15"
)]
#![feature(once_cell_try)]
#![no_std]
#![warn(rust_2018_idioms, unused_lifetimes, missing_docs)]
#![cfg_attr(docsrs, feature(doc_auto_cfg))]
Expand Down
4 changes: 1 addition & 3 deletions src/use_file.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,7 @@ extern crate std;

use crate::{util_libc::sys_fill_exact, Error};
use core::{ffi::c_void, mem::MaybeUninit};
use std::{fs::File, io, os::unix::io::AsRawFd as _};
// TODO(MSRV feature(once_cell_try)): Use std::sync::OnceLock instead.
use once_cell::sync::OnceCell as OnceLock;
use std::{fs::File, io, os::unix::io::AsRawFd as _, sync::OnceLock};

/// For all platforms, we use `/dev/urandom` rather than `/dev/random`.
/// For more information see the linked man pages in lib.rs.
Expand Down

0 comments on commit 230e895

Please sign in to comment.