Skip to content

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

Merged
merged 2 commits into from
Jul 24, 2014
Merged

Document PriorityQueue. #15856

merged 2 commits into from
Jul 24, 2014

Conversation

treeman
Copy link
Contributor

@treeman treeman commented Jul 21, 2014

Add examples to methods.

/// A priority queue implemented with a binary heap
/// A priority queue implemented with a binary heap.
///
/// This will be max-heap.
Copy link
Member

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."

@steveklabnik
Copy link
Member

Thanks so much for all of this, this is great. :) One small stylistic note: you can use vec![] as well as vec!(), and I think it's slightly preferred, since it looks a bit more like [T]. Not 100% sure on that, though.

@sinistersnare
Copy link
Contributor

+1 on vec![] instead of vec!()

@treeman
Copy link
Contributor Author

treeman commented Jul 22, 2014

I do like vec![] more. vec!() is used practically everywhere in the code and other documentation (Vec for example), but that might be the old style. Which we probably should change I gather?

@treeman
Copy link
Contributor Author

treeman commented Jul 22, 2014

Made a change at Vec doc to reflect vec![] style: #15894

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
Copy link
Member

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."

Copy link
Contributor Author

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.

@brson
Copy link
Contributor

brson commented Jul 24, 2014

Needs rebase.

@huonw
Copy link
Member

huonw commented Jul 24, 2014

r=me with that rebase (and possibly squashing the last 4 commits into a single one).

@treeman
Copy link
Contributor Author

treeman commented Jul 24, 2014

Rebased and squashed.

bors added a commit that referenced this pull request Jul 24, 2014
@bors bors closed this Jul 24, 2014
@bors bors merged commit 571692c into rust-lang:master Jul 24, 2014
@treeman treeman deleted the doc-priorityqueue branch September 17, 2014 13:12
bors added a commit to rust-lang-ci/rust that referenced this pull request Nov 16, 2023
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.
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

Successfully merging this pull request may close these issues.

6 participants