Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ergonomics: Hide context behind a feature #131

Closed
LeoniePhiline opened this issue Dec 7, 2023 · 4 comments · Fixed by #138
Closed

Ergonomics: Hide context behind a feature #131

LeoniePhiline opened this issue Dec 7, 2023 · 4 comments · Fixed by #138
Assignees
Labels
A-color-eyre Area: color-eyre subcrate C-enhancement Category: New feature or request good first issue Good for newcomers help wanted Extra attention is needed

Comments

@LeoniePhiline
Copy link
Contributor

When using eyre day by day, rust analyzer often proposes to import the Context trait, when WrapErr functions like wrap_err_with are not imported.

(Rust analyzer does not even offer importing WrapErr, but only Context. I do not know why.)

As I do not need anyhow compatibility, I would prefer mod context to be feature gated.

@ten3roberts
Copy link
Contributor

I've noticed this as well, it'll falsely import the wronf trait.

I've found the same with Error and Report, as using Report and using code-actions to import it will import Error instead and cause an use of undeclared type error.

Maybe it is better to put all those aliases under a feature, and only expose WrapErr and Report etc by default

@LeoniePhiline
Copy link
Contributor Author

I also experience the Error import when trying to import Report.

Fully agree with your proposal.

@yaahc
Copy link
Collaborator

yaahc commented Dec 12, 2023

SGTM, I have no objections to any of the suggested changes.

@yaahc yaahc added C-enhancement Category: New feature or request help wanted Extra attention is needed good first issue Good for newcomers A-color-eyre Area: color-eyre subcrate labels Dec 12, 2023
@ten3roberts ten3roberts self-assigned this Dec 20, 2023
@ten3roberts
Copy link
Contributor

I can handle any questions or reviewing that comes up later for you @LeoniePhiline

LeoniePhiline added a commit to LeoniePhiline/eyre that referenced this issue Dec 20, 2023
This change hides the `anyhow` compatibility layer
behind an `"anyhow"` feature flag.
In `eyre` v0.6 the feature is enabled by default.

Fixes eyre-rs#131
LeoniePhiline added a commit to LeoniePhiline/eyre that referenced this issue Dec 20, 2023
This change hides the `anyhow` compatibility layer
behind an `"anyhow"` feature flag.
In `eyre` v0.6 the feature is enabled by default.

Fixes eyre-rs#131
LeoniePhiline added a commit to LeoniePhiline/eyre that referenced this issue Dec 20, 2023
This change hides the `anyhow` compatibility layer
behind an `"anyhow"` feature flag.
In `eyre` v0.6 the feature is enabled by default.

Fixes eyre-rs#131
LeoniePhiline added a commit to LeoniePhiline/eyre that referenced this issue Dec 20, 2023
This change hides the `anyhow` compatibility layer
behind an `"anyhow"` feature flag.
In `eyre` v0.6 the feature is enabled by default.

Fixes eyre-rs#131
ten3roberts added a commit that referenced this issue Jan 16, 2024
This change hides the `anyhow` compatibility layer behind an `"anyhow"`
feature flag.
In `eyre` v1.0.0 the feature is currently enabled by default.

Fixes #131

---------

Co-authored-by: Freja Roberts <ten3roberts@gmail.com>
LeoniePhiline added a commit to LeoniePhiline/eyre that referenced this issue Jun 28, 2024
[eyre-rs#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 [eyre-rs#136][136]

[131]: eyre-rs#131
[136]: eyre-rs#136

BREAKING CHANGE: Removing a default feature is
                 a breaking change.
LeoniePhiline added a commit to LeoniePhiline/eyre that referenced this issue Jul 11, 2024
[eyre-rs#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 [eyre-rs#136][136]

[131]: eyre-rs#131
[136]: eyre-rs#136

BREAKING CHANGE: Removing a default feature is
                 a breaking change.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-color-eyre Area: color-eyre subcrate C-enhancement Category: New feature or request good first issue Good for newcomers help wanted Extra attention is needed
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants