Skip to content

Commit 4c48584

Browse files
committedFeb 4, 2024
feat(deps): remove once_cell dep in favor of std::sync::OnceLock
BREAKING CHANGE: This requires an MSRV bump to 1.70.0.
1 parent e5c7ae4 commit 4c48584

File tree

2 files changed

+2
-4
lines changed

2 files changed

+2
-4
lines changed
 

‎Cargo.toml

-1
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@ exclude = ["images/", "tests/", "miette-derive/"]
1515
[dependencies]
1616
thiserror = "1.0.40"
1717
miette-derive = { path = "miette-derive", version = "=5.10.0", optional = true }
18-
once_cell = "1.8.0"
1918
unicode-width = "0.1.9"
2019

2120
owo-colors = { version = "3.4.0", optional = true }

‎src/eyreish/mod.rs

+2-3
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,7 @@
77
use core::fmt::Display;
88

99
use std::error::Error as StdError;
10-
11-
use once_cell::sync::OnceCell;
10+
use std::sync::OnceLock;
1211

1312
#[allow(unreachable_pub)]
1413
pub use into_diagnostic::*;
@@ -62,7 +61,7 @@ unsafe impl Send for Report {}
6261
pub type ErrorHook =
6362
Box<dyn Fn(&(dyn Diagnostic + 'static)) -> Box<dyn ReportHandler> + Sync + Send + 'static>;
6463

65-
static HOOK: OnceCell<ErrorHook> = OnceCell::new();
64+
static HOOK: OnceLock<ErrorHook> = OnceLock::new();
6665

6766
/// Error indicating that [`set_hook()`] was unable to install the provided
6867
/// [`ErrorHook`].

0 commit comments

Comments
 (0)
Please sign in to comment.