Skip to content
This repository was archived by the owner on Aug 1, 2024. It is now read-only.

Ergonomics: Full re-exports from eyre; export color_eyre::eyre! macro, rather than eyre crate #145

@LeoniePhiline

Description

@LeoniePhiline

I commonly use color_eyre and its re-exports from eyre.

However, not all commonly used symbols are re-exported. This results in nested imports like:

use color_eyre::{
    eyre::{bail, eyre, WrapErr},
    Report, Result,
};

The ambiguity between color_eyre::eyre (the crate re-export) and color_eyre::eyre::eyre (the macro) is also a pain point in my daily work.

(Rust analyzer unfortunately makes this worse by onlym despite the ! postfix, offering an auto-import of color_eyre::eyre instead of the correct color_eyre::eyre::eyre when eyre! is not in scope.)

From an ergonomics standpoint, I would wish for the full eyre feature-set (including e.g. WrapErr and OptionExt) to be re-exported from color_eyre:

use color_eyre::{bail, eyre, OptionExt, Report, Result, WrapErr};

In the above hypothetical use statement, the eyre imports the eyre! macro, not the eyre crate.

This is a breaking change.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions