derive_more icon indicating copy to clipboard operation
derive_more copied to clipboard

Support thiserror like formatting for Display derive

Open Luro02 opened this issue 3 years ago • 1 comments

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.

Luro02 avatar Jun 09 '21 07:06 Luro02

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

JelteF avatar Jun 19 '21 12:06 JelteF

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

tyranron avatar Aug 22 '22 10:08 tyranron