From c18fdf4cdfd8bffee759b6a4e926687238d031d2 Mon Sep 17 00:00:00 2001 From: 0xadk <0xadk@users.noreply.github.com> Date: Tue, 30 Jul 2024 22:55:34 -0700 Subject: [PATCH] feat(color-eyre): add default `export-owo-colors` feature Reexporting `owo-colors` causes rust-analzyer's code completion to fill with many auto-use suggestions for the `owo-colors::OwoColorize` trait. This feature allows users to opt-out of reexporting `owo-colors`. --- color-eyre/Cargo.toml | 3 ++- color-eyre/src/lib.rs | 1 + 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/color-eyre/Cargo.toml b/color-eyre/Cargo.toml index 145fb17..4f28456 100644 --- a/color-eyre/Cargo.toml +++ b/color-eyre/Cargo.toml @@ -12,10 +12,11 @@ readme = { workspace = true } rust-version = { workspace = true } [features] -default = ["track-caller", "capture-spantrace"] +default = ["track-caller", "capture-spantrace", "export-owo-colors"] capture-spantrace = ["tracing-error", "color-spantrace"] issue-url = ["url"] track-caller = [] +export-owo-colors = [] [dependencies] eyre = "0.6.1" diff --git a/color-eyre/src/lib.rs b/color-eyre/src/lib.rs index 2664cad..dfcf43c 100644 --- a/color-eyre/src/lib.rs +++ b/color-eyre/src/lib.rs @@ -365,6 +365,7 @@ pub use eyre; pub use eyre::Report; #[doc(hidden)] pub use eyre::Result; +#[cfg(feature = "export-owo-colors")] pub use owo_colors; use section::help::HelpInfo; #[doc(hidden)]