-
Notifications
You must be signed in to change notification settings - Fork 12.9k
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
Main example for HashSet. #15667
Main example for HashSet. #15667
Conversation
@alexcrichton It appears I have accidentally pushed up some more documentation changes to this pull request instead of creating a new. Shall I create a new one or roll with this? |
That's ok, I'll take a peek |
@@ -689,7 +689,7 @@ impl DefaultResizePolicy { | |||
/// 3. Emmanuel Goossaert. ["Robin Hood hashing: backward shift | |||
/// deletion"](http://codecapsule.com/2013/11/17/robin-hood-hashing-backward-shift-deletion/) | |||
/// | |||
/// # Example | |||
/// ## Example |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The predominant style in the rest of the documentation is to use one hash mark, why change to two?
Thanks for all the new examples! |
Thanks for the pointers. |
Looks good to me! Could you squash the commits into one with a description about what documentation was added? |
Add main example and simple examples for the methods.
Done. |
Example code for HashSet, similar to the [HashMap example](http://doc.rust-lang.org/std/collections/hashmap/struct.HashMap.html).
…ykril fix: make bool_to_enum assist create enum at top-level This pr makes the `bool_to_enum` assist create the `enum` at the next closest module block or at top-level, which fixes a few tricky cases such as with an associated `const` in a trait or module: ```rust trait Foo { const $0BOOL: bool; } impl Foo for usize { const BOOL: bool = true; } fn main() { if <usize as Foo>::BOOL { println!("foo"); } } ``` Which now properly produces: ```rust #[derive(PartialEq, Eq)] enum Bool { True, False } trait Foo { const BOOL: Bool; } impl Foo for usize { const BOOL: Bool = Bool::True; } fn main() { if <usize as Foo>::BOOL == Bool::True { println!("foo"); } } ``` I also think it's a bit nicer, especially for local variables, but didn't really know to do it in the first PR :)
Example code for HashSet, similar to the HashMap example.