feat(deps): remove once_cell dep in favor of `std::sync::OnceLock`

BREAKING CHANGE: This requires an MSRV bump to 1.70.0.
This commit is contained in:
Kat Marchán 2024-02-03 19:29:28 -08:00
parent e5c7ae469e
commit 4c48584f30
No known key found for this signature in database
GPG Key ID: AEB529C08A3C7E9E
2 changed files with 2 additions and 4 deletions

View File

@ -15,7 +15,6 @@ exclude = ["images/", "tests/", "miette-derive/"]
[dependencies]
thiserror = "1.0.40"
miette-derive = { path = "miette-derive", version = "=5.10.0", optional = true }
once_cell = "1.8.0"
unicode-width = "0.1.9"
owo-colors = { version = "3.4.0", optional = true }

View File

@ -7,8 +7,7 @@
use core::fmt::Display;
use std::error::Error as StdError;
use once_cell::sync::OnceCell;
use std::sync::OnceLock;
#[allow(unreachable_pub)]
pub use into_diagnostic::*;
@ -62,7 +61,7 @@ unsafe impl Send for Report {}
pub type ErrorHook =
Box<dyn Fn(&(dyn Diagnostic + 'static)) -> Box<dyn ReportHandler> + Sync + Send + 'static>;
static HOOK: OnceCell<ErrorHook> = OnceCell::new();
static HOOK: OnceLock<ErrorHook> = OnceLock::new();
/// Error indicating that [`set_hook()`] was unable to install the provided
/// [`ErrorHook`].