Closed imp closed 4 years ago
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.
> file src/*
src/ipext.rs: ASCII text, with CRLF line terminators
src/ipnet.rs: ASCII text, with CRLF line terminators
src/ipnet_serde.rs: c program text, ASCII text
src/lib.rs: c program text, ASCII text
src/parser.rs: ASCII text, with CRLF line terminators
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.