derive_more icon indicating copy to clipboard operation
derive_more copied to clipboard

Some more derive(Trait) options

Results 113 derive_more issues
Sort by recently updated
recently updated
newest added
trafficstars

For example, given this struct: ```rust #[derive(Constructor)] struct Foo { x: f32, y: f32 } ``` The generated code should be: ```rust impl Foo { const fn new(x: f32, y:...

Simple constructors and a few other functions are normally never complex (they generate few lines of assembly). Marking those as inline can greatly improve performance for if they are used...

Resolves #184 This PR errors on invalid `#[display(...)]` arguments and adds tests for compiler errors with [`trybuild`](https://docs.rs/trybuild/1.0.56/trybuild/) crate.

Consider this code: ```rust use derive_more::Display; #[derive(Display)] #[display(fmt = "Stuff({})", .bar)] pub struct Foo { bar: String } fn main() { println!("{}", Foo { bar: "test".into() }); } ``` This...

bug

*I'm submitting this as an issue to gather feedback; I'm happy to do the work on an implementation if this is a desired feature.* --- Currently I can use a...

In the following project, * `Cargo.toml`: ``` [workspace] members = ["core"] ``` * `core/Cargo.toml`: ``` [package] name = "core" version = "0.1.0" edition = "2021" [dependencies] derive_more = "0.99" ```...

Rather than returning a string as an error, might it not be better to use a struct that stores the type and variant names as strings, which implements Display to...

I want to do this in a PR if someone else can figure out the naming. # Feature A derive macro that emits a duplicate of the input enum type,...

enhancement
new derive

I have code where I use `try_into` to match against another enum (generated by another macro), however I need the original input value in the case that the `try_into` failed....

I would love to be able to do this: ```rust #[derive(Display)] #[display("{major}.{minor}.{patch}")] pub struct Version { major: usize, minor: usize, patch: usize, } ``` instead of ```rust #[derive(Display)] #[display(fmt =...