From 08bb4affca63f442a791d24933864e93c477e392 Mon Sep 17 00:00:00 2001 From: Boshen Date: Thu, 22 Feb 2024 14:21:02 +0800 Subject: [PATCH] refactor: make `fancy-no-syscall` the base feature --- Cargo.toml | 3 +-- src/eyreish/mod.rs | 8 ++++---- src/handlers/mod.rs | 8 ++++---- src/lib.rs | 6 +++--- 4 files changed, 12 insertions(+), 13 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index bfe056d..3487e01 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -53,8 +53,7 @@ fancy-no-syscall = [ "textwrap", ] fancy-no-backtrace = [ - "owo-colors", - "textwrap", + "fancy-no-syscall", "terminal_size", "supports-hyperlinks", "supports-color", diff --git a/src/eyreish/mod.rs b/src/eyreish/mod.rs index 0dfd878..169df13 100644 --- a/src/eyreish/mod.rs +++ b/src/eyreish/mod.rs @@ -24,10 +24,10 @@ pub use ReportHandler as EyreContext; #[allow(unreachable_pub)] pub use WrapErr as Context; -#[cfg(not(feature = "fancy-no-backtrace"))] +#[cfg(not(feature = "fancy-no-syscall"))] use crate::DebugReportHandler; use crate::Diagnostic; -#[cfg(feature = "fancy-no-backtrace")] +#[cfg(feature = "fancy-no-syscall")] use crate::MietteHandler; use error::ErrorImpl; @@ -102,9 +102,9 @@ fn capture_handler(error: &(dyn Diagnostic + 'static)) -> Box } fn get_default_printer(_err: &(dyn Diagnostic + 'static)) -> Box { - #[cfg(feature = "fancy-no-backtrace")] + #[cfg(feature = "fancy-no-syscall")] return Box::new(MietteHandler::new()); - #[cfg(not(feature = "fancy-no-backtrace"))] + #[cfg(not(feature = "fancy-no-syscall"))] return Box::new(DebugReportHandler::new()); } diff --git a/src/handlers/mod.rs b/src/handlers/mod.rs index fde2dc9..169958a 100644 --- a/src/handlers/mod.rs +++ b/src/handlers/mod.rs @@ -5,20 +5,20 @@ Reporters included with `miette`. #[allow(unreachable_pub)] pub use debug::*; #[allow(unreachable_pub)] -#[cfg(feature = "fancy-no-backtrace")] +#[cfg(feature = "fancy-no-syscall")] pub use graphical::*; #[allow(unreachable_pub)] pub use json::*; #[allow(unreachable_pub)] pub use narratable::*; #[allow(unreachable_pub)] -#[cfg(feature = "fancy-no-backtrace")] +#[cfg(feature = "fancy-no-syscall")] pub use theme::*; mod debug; -#[cfg(feature = "fancy-no-backtrace")] +#[cfg(feature = "fancy-no-syscall")] mod graphical; mod json; mod narratable; -#[cfg(feature = "fancy-no-backtrace")] +#[cfg(feature = "fancy-no-syscall")] mod theme; diff --git a/src/lib.rs b/src/lib.rs index 7891511..31a900f 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -760,7 +760,7 @@ pub use miette_derive::*; pub use error::*; pub use eyreish::*; -#[cfg(feature = "fancy-no-backtrace")] +#[cfg(feature = "fancy-no-syscall")] pub use handler::*; pub use handlers::*; pub use miette_diagnostic::*; @@ -773,10 +773,10 @@ mod chain; mod diagnostic_chain; mod error; mod eyreish; -#[cfg(feature = "fancy-no-backtrace")] +#[cfg(feature = "fancy-no-syscall")] mod handler; mod handlers; -#[cfg(feature = "fancy-no-backtrace")] +#[cfg(feature = "fancy-no-syscall")] pub mod highlighters; #[doc(hidden)] pub mod macro_helpers;