Skip to content

Commit

Permalink
chore!: remove anyhow from default features
Browse files Browse the repository at this point in the history
[#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]: #131
[136]: #136

BREAKING CHANGE: Removing a default feature is
                 a breaking change.
  • Loading branch information
LeoniePhiline committed Jun 28, 2024
1 parent 9498677 commit f48df11
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 9 deletions.
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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`
Expand Down
2 changes: 1 addition & 1 deletion eyre/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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 = []
Expand Down
8 changes: 4 additions & 4 deletions eyre/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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`
Expand Down

0 comments on commit f48df11

Please sign in to comment.