Skip to content
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

Missing slice diagram #113

Closed
pickfire opened this issue Nov 9, 2020 · 2 comments
Closed

Missing slice diagram #113

pickfire opened this issue Nov 9, 2020 · 2 comments
Labels
type: content Actual content to appear on cheat sheet.

Comments

@pickfire
Copy link
Contributor

pickfire commented Nov 9, 2020

We were explaining slice to a beginner in Rust 众 telegram and found that slice diagram were missing. It should be beside Vec and Box explaination.

@ralfbiedert
Copy link
Owner

I'm a bit confused. Shouldn't this cover slices (under "References & Pointers")?

image

The reason it's not near Vec is because those types use heap storage.

@ralfbiedert ralfbiedert added the type: content Actual content to appear on cheat sheet. label Nov 9, 2020
ralfbiedert added a commit that referenced this issue Nov 9, 2020
@ralfbiedert
Copy link
Owner

ralfbiedert commented Nov 9, 2020

Ok, I realized the visualizations were actually not that clear around slices, and I assume you meant the difference between true slices [T] and slice references &[T].

I pushed an update, please let me know if you think this clarifies things.

image

image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: content Actual content to appear on cheat sheet.
Projects
None yet
Development

No branches or pull requests

2 participants