Gankra / collect-rs

Miscellaneous Collections
Apache License 2.0
64 stars 21 forks source link

Document trait impl behavior #133

Closed apasel422 closed 9 years ago

apasel422 commented 9 years ago

All implementations of (at least) the following traits should specify their exact behavior using a doc comment on the appropriate impl methods:

Additionally, all types implementing Iterator should document their ordering invariants (including the case in which there are none).

Gankra commented 9 years ago

Default, Extend, and FromIterator all seem obvious? Default is sugar for new, and Extend and FromIterator are sugar for the simplest insertion.

Eq and Ord, I guess are a bit nontrivial...

apasel422 commented 9 years ago

Hmm, I guess those three are normally obvious, but {Eq, Ord} seem important to specify, especially because it's so easy to silently break code that is using them.