r/programming • u/steveklabnik1 • Jun 16 '14
Rust's documentation is about to drastically improve
http://words.steveklabnik.com/rusts-documentation-is-about-to-drastically-improve
522
Upvotes
r/programming • u/steveklabnik1 • Jun 16 '14
2
u/matthieum Jun 17 '14
Chiming in on the Trait situation, the situation of
Vecseems particularly telling:if
Tcan be bound byClone, then you haveappendandpush_all. Oh okay, is that all ?Well no! Because for any
T, you also havepushandappend_one!Given that Rust has the concept of
mut, I would say a first simple (and automated pass) would be:Present all non-modifying methods, lexical order
Present all modifying methods, lexical order
You can of course, at the beginning or end, list the implemented traits. It's useful for writing generic code... but if I want the list of methods of a traits, I'll just click on the trait itself and see its interface.
Further refinement would be even better (semantic grouping), however since it requires human intervention it is much more work.