mirror of https://github.com/zkat/miette.git
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:
parent
e5c7ae469e
commit
4c48584f30
|
|
@ -15,7 +15,6 @@ exclude = ["images/", "tests/", "miette-derive/"]
|
||||||
[dependencies]
|
[dependencies]
|
||||||
thiserror = "1.0.40"
|
thiserror = "1.0.40"
|
||||||
miette-derive = { path = "miette-derive", version = "=5.10.0", optional = true }
|
miette-derive = { path = "miette-derive", version = "=5.10.0", optional = true }
|
||||||
once_cell = "1.8.0"
|
|
||||||
unicode-width = "0.1.9"
|
unicode-width = "0.1.9"
|
||||||
|
|
||||||
owo-colors = { version = "3.4.0", optional = true }
|
owo-colors = { version = "3.4.0", optional = true }
|
||||||
|
|
|
||||||
|
|
@ -7,8 +7,7 @@
|
||||||
use core::fmt::Display;
|
use core::fmt::Display;
|
||||||
|
|
||||||
use std::error::Error as StdError;
|
use std::error::Error as StdError;
|
||||||
|
use std::sync::OnceLock;
|
||||||
use once_cell::sync::OnceCell;
|
|
||||||
|
|
||||||
#[allow(unreachable_pub)]
|
#[allow(unreachable_pub)]
|
||||||
pub use into_diagnostic::*;
|
pub use into_diagnostic::*;
|
||||||
|
|
@ -62,7 +61,7 @@ unsafe impl Send for Report {}
|
||||||
pub type ErrorHook =
|
pub type ErrorHook =
|
||||||
Box<dyn Fn(&(dyn Diagnostic + 'static)) -> Box<dyn ReportHandler> + Sync + Send + 'static>;
|
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
|
/// Error indicating that [`set_hook()`] was unable to install the provided
|
||||||
/// [`ErrorHook`].
|
/// [`ErrorHook`].
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue