-
Notifications
You must be signed in to change notification settings - Fork 29
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
Please derive/implement Default trait #18
Comments
Hi @imp, is Default implemented for all the underlying traits already? If not what are you thinking the default should be, presumably 0/0 and ::/0? |
Yes, I believe zeroes should be fine. Anything else would be very much opinionated. Those who care will set it to whatever they need, those who don't care - well, just don't care. And that's for structs, right? Not traits? |
Something like this - #19 |
Thanks, my next question was going to be do you want to send me a pull request for it :-) Just for completeness, are you able to add some simple tests for your default implementation. Then I'll go ahead and merge it. |
Added tests. |
BTW, some files are with DOS EOL (CRLF), while others are UNIX (LF). This confuses editors and causes gratuitous reformatting.
Would you accept a PR to reformat all the files to LF line ending? |
Absolutely, your PRs are very much welcomed. |
Thanks! #19 has been updated. |
Merged into 2.3.0. |
The types in this crate are very useful and practical. The life of the consumers may be even easier if these types will be implementing
Default
trait. We are using these types as a part of a complex structures whereDefault
is required. Right now it forces us to implement it manually instead of deriving.The text was updated successfully, but these errors were encountered: