-
Notifications
You must be signed in to change notification settings - Fork 13.3k
Document PriorityQueue. #15856
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
Document PriorityQueue. #15856
Conversation
/// A priority queue implemented with a binary heap | ||
/// A priority queue implemented with a binary heap. | ||
/// | ||
/// This will be max-heap. |
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.
"This will be a max-heap."
Thanks so much for all of this, this is great. :) One small stylistic note: you can use |
+1 on |
I do like |
Made a change at |
pub fn new() -> PriorityQueue<T> { PriorityQueue{data: vec!(),} } | ||
|
||
/// Create an empty PriorityQueue with a specific capacity. | ||
/// This pre-allocates memory so we don't have to allocate |
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.
"This preallocates enough memory for capacity
elements, so that the PriorityQueue
does not have to be reallocated until it contains at least that many values."
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.
Thanks, this is much better.
Needs rebase. |
r=me with that rebase (and possibly squashing the last 4 commits into a single one). |
Rebased and squashed. |
minor: Make "Expand macro" command title more explicit Closes [rust-lang#15856](rust-lang/rust-analyzer#15856). I opted for "caret", since it's the better term (cursor is the mouse), but I'm not sure how popular it is these days.
Add examples to methods.