derive_more icon indicating copy to clipboard operation
derive_more copied to clipboard

Add support for deriving Default

Open GnomedDev opened this issue 2 years ago • 4 comments
trafficstars

I would love to migrate some libraries from the unmaintained derivative to this crate, but it is missing deriving Default with custom values. If the "custom bound" functionality from https://mcarton.github.io/rust-derivative/latest/Default.html could be implemented that would be fabulous.

GnomedDev avatar Nov 17 '23 00:11 GnomedDev

Sounds like a good derive to also support in derive_more. Feel free to contribute a PR for it.

JelteF avatar Nov 17 '23 00:11 JelteF

Regarding custom bounds: so far we've been able to avoid supporting that for other derives by actually generating the correct bounds. If that's possible here too that would be great.

JelteF avatar Nov 17 '23 01:11 JelteF

This is very similar to #311 btw, only for different traits.

JelteF avatar Dec 18 '23 20:12 JelteF

https://lib.rs/crates/smart-default could be inspiration for the api

ModProg avatar Dec 21 '23 18:12 ModProg