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

A simple guide to choosing an appropriate data structure from the stdlib #10033

Closed
bstrie opened this issue Oct 23, 2013 · 3 comments
Closed

Comments

@bstrie
Copy link
Contributor

bstrie commented Oct 23, 2013

I ran across this guide to selecting a container from the types offered in C++'s STL:
hnmy4
Something similar might be useful for navigating Rust's std and extra containers (though it doesn't necessarily need to be an image).

@thestinger
Copy link
Contributor

This is essentially what I intend to do with the current stub container tutorial, by adding a table showing the asymptotic performance of various operations and mentioning the other useful properties of various containers.

@pnkfelix
Copy link
Member

part of #11755

@steveklabnik
Copy link
Member

I'm pulling a massive triage effort to get us ready for 1.0. As part of this, I'm moving stuff that's wishlist-like to the RFCs repo, as that's where major new things should get discussed/prioritized.

This issue has been moved to the RFCs repo: rust-lang/rfcs#780

flip1995 pushed a commit to flip1995/rust that referenced this issue Jun 30, 2023
[`unnecessary_to_owned`]: check that the adjusted type matches target

Fixes rust-lang#10033.

Before this change, the lint would assume that removing the `.to_string()` in `f(&x.to_string())` would be ok if x is of some type that implements `Deref<Target = str>` and `f` takes a `&str`.
This turns out to not actually be ok if the `to_string` call is some method that exists on `x` directly, which happens if it implements `Display`/`ToString` itself.

changelog: [`unnecessary_to_owned`]: only lint if the adjusted receiver type actually matches
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants