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.
This commit is contained in:
Ivan Molodetskikh
2025-02-16 19:30:33 +03:00
parent a693f64c41
commit 108e88e211
4 changed files with 2 additions and 68 deletions
+1 -2
View File
@@ -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"
+1 -7
View File
@@ -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()