derive_more
derive_more copied to clipboard
Use Into<_> for datatypes when deriving Constructor
trafficstars
To improve ergonomics, instead of requiring specific datatypes instead use Into<_> for those datatypes. So instead of something like
impl MyInts {
fn new(__0: i32, __1: i32) -> MyInts {
MyInts(__0, __1)
}
}
something like
impl MyInts {
fn new<T: Into<i32>, U: Into<i32>>(__0: T, __1: U) -> MyInts {
MyInts(__0.into(), __1.into())
}
}
Good suggestion, same goes for From derivation. Not sure when I find the time to do this though.
Maybe it's worth reaching out to people on This Week in Rust on their Calls for Participation section. If you tag bugs as easy with enough of a description, might be able to get some new blood in here writing PRs!