From 0eb8d50da82daea4ba4ebba348fa7e895ea5a062 Mon Sep 17 00:00:00 2001 From: LeoniePhiline <22329650+LeoniePhiline@users.noreply.github.com> Date: Fri, 28 Jun 2024 23:34:04 +0200 Subject: [PATCH] chore!: remove `anyhow` from default features [#131][131] introduced a new anyhow default feature flag to allow users to hide aliased exports such as `eyre::Error` and `eyre::Context`. This changeset removes `anyhow` from the list of default features, making the compatibility layer with the anyhow crate opt-in. Implements [#136][136] [131]: https://github.com/eyre-rs/eyre/issues/131 [136]: https://github.com/eyre-rs/eyre/issues/136 BREAKING CHANGE: Removing a default feature is a breaking change. --- README.md | 8 ++++---- eyre/Cargo.toml | 2 +- eyre/src/lib.rs | 8 ++++---- 3 files changed, 9 insertions(+), 9 deletions(-) diff --git a/README.md b/README.md index 31e25a9..29f1674 100644 --- a/README.md +++ b/README.md @@ -205,12 +205,12 @@ vice-versa by `re-exporting` all of the renamed APIs with the names used in ### Disabling the compatibility layer -The `anyhow` compatibility layer is enabled by default. -If you do not need anyhow compatibility, it is advisable -to disable the `"anyhow"` feature: +The `anyhow` compatibility layer is disabled by default. +If you need anyhow compatibility, it is advisable +to enable the `"anyhow"` feature: ```toml -eyre = { version = "0.6", default-features = false, features = ["auto-install", "track-caller"] } +eyre = { version = "0.6", features = ["anyhow"] } ``` ### `Context` and `Option` diff --git a/eyre/Cargo.toml b/eyre/Cargo.toml index 5ea7eaf..7030a66 100644 --- a/eyre/Cargo.toml +++ b/eyre/Cargo.toml @@ -13,7 +13,7 @@ readme = { workspace = true } rust-version = { workspace = true } [features] -default = ["anyhow", "auto-install", "track-caller"] +default = ["auto-install", "track-caller"] anyhow = [] auto-install = [] track-caller = [] diff --git a/eyre/src/lib.rs b/eyre/src/lib.rs index 93ec747..1b599d9 100644 --- a/eyre/src/lib.rs +++ b/eyre/src/lib.rs @@ -267,12 +267,12 @@ //! //! ### Disabling the compatibility layer //! -//! The `anyhow` compatibility layer is enabled by default. -//! If you do not need anyhow compatibility, it is advisable -//! to disable the `"anyhow"` feature: +//! The `anyhow` compatibility layer is disabled by default. +//! If you need anyhow compatibility, it is advisable +//! to enable the `"anyhow"` feature: //! //! ```toml -//! eyre = { version = "0.6", default-features = false, features = ["auto-install", "track-caller"] } +//! eyre = { version = "0.6", features = ["anyhow"] } //! ``` //! //! ### `Context` and `Option`