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

Use derive_more crate to derive basic arithmetic traits #260

Closed
JelteF opened this issue Feb 3, 2017 · 2 comments
Closed

Use derive_more crate to derive basic arithmetic traits #260

JelteF opened this issue Feb 3, 2017 · 2 comments

Comments

@JelteF
Copy link

JelteF commented Feb 3, 2017

I've created a library called derive_more that allows deriving of basic traits to decrease boilerplate code, such as From, Add, and Mul. With the recent release of Rust 1.15 it now works on stable rust.
I think this would be a crate that would benefit from using it. For instance this code could be derived with the library: https://github.com/rust-num/num/blob/master/complex/src/lib.rs#L442-L462

I don't mind making a pull request for this, but wanted to ask first i it is even wanted.

@cuviper
Copy link
Member

cuviper commented Feb 3, 2017

First of all, we treat raising the rustc requirement as a breaking change. I know not everyone agrees with that policy, but I prefer the more conservative position. We might raise the bar a little for #257, or go ahead and break a lot for #261, not sure yet.

I think derive_more looks nice in general, especially for folks writing newtypes and enum wrappers. I'm just not sure we have enough use for it here to justify an extra dependency. I think Complex might be the only case that could really use it, and that boilerplate is pretty simple, and already written anyway.

remexre pushed a commit to remexre/num that referenced this issue Jun 1, 2017
Expose the various Read implementations
@cuviper
Copy link
Member

cuviper commented Sep 22, 2017

I don't think we'll do this without stronger justification.

@cuviper cuviper closed this as completed Sep 22, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants