Rust: Incorporate @raphlinus' container cheat sheet into the std::collections module docs

Created on 3 Jun 2017  Ā·  11Comments  Ā·  Source: rust-lang/rust

The suggestion to incorporate @raphlinus' container cheat sheet was made by @leonardo-m over on https://github.com/rust-lang/book/issues/741, and @steveklabnik and I agree that it's a better fit for the API docs rather than the book (since the book is aiming to be a narrative intro to Rust, not a comprehensive reference).

Raph has noted that the cheat sheet is Copyright 2017 Google Inc., released under Creative Commons BY, so I don't think that should be a problem for us to incorporate as long as we note those things (but IANAL)

A-collections C-enhancement I-needs-decision T-libs

Most helpful comment

std already has several pieces of documentation that exempt themselves from stability guarantees. E.g.

Maybe it would make sense to have a standard marker for these kinds of things. E.g. w3c specs oven have non-normative sections. Similarly java docs have annotations for implementation notes that are subject to change

All 11 comments

This is documenting (read: semi-stabilises) internal implementation details which could change at any time.

Note that cheat sheet contains some small mistakes and imprecisions.

Regarding the problem of documenting internal implementation details, when those details change, the sheet should be updated. The purpose of those images is to help a Rust programmer know what she or he is using. If you don't know those things you can't program well in Rust.

Well I’m all fine with it, as long as people do not transmute the types/do some other black magic and then come over crying because it was ā€œdocumentedā€.

But I agree it's surely a risk, even if you write very well in the page that those images are not meant to be used that way, etc.

@rust-lang/libs, should we do this or not? I share @nagisa 's concerns.

There was a question regarding references on Reddit recently. I believe this (or similar) visualization would be very helpful for beginners.

There should be a big warning about not transmuting stuff and not relying on that layout. If someone will ignore that, he will probably ignore many other things.

The current version needs a touch of updating before inclusion though.

This is also available in https://cheats.rs/#standard-library-types

@Dylan-DPC Maybe we can label hacktoberfest?

cc @rust-lang/rustdoc @jyn514 (I don't know if I CCed the correct team)

we normally don't label issues for hacktoberfest :P

std already has several pieces of documentation that exempt themselves from stability guarantees. E.g.

Maybe it would make sense to have a standard marker for these kinds of things. E.g. w3c specs oven have non-normative sections. Similarly java docs have annotations for implementation notes that are subject to change

Was this page helpful?
0 / 5 - 0 ratings