diff options
| author | Ivan Molodetskikh <yalterz@gmail.com> | 2025-02-16 19:30:33 +0300 |
|---|---|---|
| committer | Ivan Molodetskikh <yalterz@gmail.com> | 2025-02-16 19:37:37 +0300 |
| commit | 108e88e211e783cc480fc3ae3fc84ddf9956d977 (patch) | |
| tree | cf6ca87c4c1df74d1a542a3c346b8445168cc5b7 /niri-config | |
| parent | a693f64c4146909c295c63b6c1696148f4138a19 (diff) | |
| download | niri-108e88e211e783cc480fc3ae3fc84ddf9956d977.tar.gz niri-108e88e211e783cc480fc3ae3fc84ddf9956d977.tar.bz2 niri-108e88e211e783cc480fc3ae3fc84ddf9956d977.zip | |
Enable fancy miette errors for the main binary
Seems there's not much dependency/binary size impact now, compared to when I
first made the KDL config.
Diffstat (limited to 'niri-config')
| -rw-r--r-- | niri-config/Cargo.toml | 3 | ||||
| -rw-r--r-- | niri-config/src/lib.rs | 8 |
2 files changed, 2 insertions, 9 deletions
diff --git a/niri-config/Cargo.toml b/niri-config/Cargo.toml index faf899a0..ec7a8e3d 100644 --- a/niri-config/Cargo.toml +++ b/niri-config/Cargo.toml @@ -11,7 +11,7 @@ repository.workspace = true bitflags.workspace = true csscolorparser = "0.7.0" knuffel = "3.2.0" -miette = "5.10.0" +miette = { version = "5.10.0", features = ["fancy-no-backtrace"] } niri-ipc = { version = "25.1.0", path = "../niri-ipc" } regex = "1.11.1" smithay = { workspace = true, features = ["backend_libinput"] } @@ -20,5 +20,4 @@ tracy-client.workspace = true [dev-dependencies] insta.workspace = true -miette = { version = "5.10.0", features = ["fancy"] } pretty_assertions = "1.4.1" diff --git a/niri-config/src/lib.rs b/niri-config/src/lib.rs index 54e2a3a9..769f5eba 100644 --- a/niri-config/src/lib.rs +++ b/niri-config/src/lib.rs @@ -12,7 +12,7 @@ use bitflags::bitflags; use knuffel::errors::DecodeError; use knuffel::Decode as _; use layer_rule::LayerRule; -use miette::{miette, Context, IntoDiagnostic, NarratableReportHandler}; +use miette::{miette, Context, IntoDiagnostic}; use niri_ipc::{ ColumnDisplay, ConfiguredMode, LayoutSwitchTarget, PositionChange, SizeChange, Transform, WorkspaceReferenceArg, @@ -3509,10 +3509,6 @@ impl FromStr for Percent { } } -pub fn set_miette_hook() -> Result<(), miette::InstallError> { - miette::set_hook(Box::new(|_| Box::new(NarratableReportHandler::new()))) -} - #[cfg(test)] mod tests { use insta::{assert_debug_snapshot, assert_snapshot}; @@ -3523,8 +3519,6 @@ mod tests { #[track_caller] fn do_parse(text: &str) -> Config { - let _ = set_miette_hook(); - Config::parse("test.kdl", text) .map_err(miette::Report::new) .unwrap() |
