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

Support thiserror like formatting for Display derive #162

Closed
Luro02 opened this issue Jun 9, 2021 · 2 comments · Fixed by #182
Closed

Support thiserror like formatting for Display derive #162

Luro02 opened this issue Jun 9, 2021 · 2 comments · Fixed by #182
Milestone

Comments

@Luro02
Copy link

Luro02 commented Jun 9, 2021

I would love to be able to do this:

#[derive(Display)]
#[display("{major}.{minor}.{patch}")]
pub struct Version {
    major: usize,
    minor: usize,
    patch: usize,
}

instead of

#[derive(Display)]
#[display(fmt = "{}.{}.{}", major, minor, patch)]
pub struct Version {
    major: usize,
    minor: usize,
    patch: usize,
}

thiserror allows the first example, so it should be possible to be implemented.

@JelteF
Copy link
Owner

JelteF commented Jun 19, 2021

I would definitly like to have this feature, feel free to open a PR implementing it.

@tyranron
Copy link
Collaborator

@JelteF I believe this has been fully covered by #182

@tyranron tyranron added this to the 1.0.0 milestone Aug 22, 2022
@tyranron tyranron linked a pull request Aug 22, 2022 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants