Skip to content

Commit

Permalink
feat(deps): remove once_cell dep in favor of std::sync::OnceLock
Browse files Browse the repository at this point in the history
BREAKING CHANGE: This requires an MSRV bump to 1.70.0.
  • Loading branch information
zkat committed Feb 4, 2024
1 parent e5c7ae4 commit 4c48584
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 4 deletions.
1 change: 0 additions & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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 }
Expand Down
5 changes: 2 additions & 3 deletions src/eyreish/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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::*;
Expand Down Expand Up @@ -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`].
Expand Down

0 comments on commit 4c48584

Please sign in to comment.