From e56aeebe75ae66becb4346f36b96014ecb25d0da 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 `export-owo-colors` feature Always 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 2b5b658..b4f0d82 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 = { version = "1.0.0", path = "../eyre" } 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)]