-
Notifications
You must be signed in to change notification settings - Fork 13.4k
Improvements to BTreeSet
documentation.
#38208
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Conversation
2e7deb7
to
dfd8739
Compare
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.
Just a few nits and should be good to go!
@@ -74,53 +74,91 @@ pub struct BTreeSet<T> { | |||
map: BTreeMap<T, ()>, | |||
} | |||
|
|||
/// An iterator over a BTreeSet's items. | |||
/// An iterator over a `BTreeSet`'s items. |
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.
a BTreeSet
's itemS?
EDIT: Actually, it can be understood differently. Well, leaving this comment here anyway.
/// An iterator over a BTreeSet's items. | ||
/// An iterator over a `BTreeSet`'s items. | ||
/// | ||
/// This structure is created by the [`iter`] method on [`BTreeSet`]. |
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.
"iter()".
/// An owning iterator over a BTreeSet's items. | ||
/// An owning iterator over a `BTreeSet`'s items. | ||
/// | ||
/// This structure is created by the [`into_iter`] method on [`BTreeSet`] |
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.
"into_iter()"
/// An iterator over a sub-range of BTreeSet's items. | ||
/// An iterator over a sub-range of `BTreeSet`'s items. | ||
/// | ||
/// This structure is created by the [`range`] method on [`BTreeSet`]. |
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.
"range()"
pub struct Range<'a, T: 'a> { | ||
iter: ::btree_map::Range<'a, T, ()>, | ||
} | ||
|
||
/// A lazy iterator producing elements in the set difference (in-order). | ||
/// | ||
/// This structure is created by the [`difference`] method on [`BTreeSet`]. |
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.
"difference()"
#[stable(feature = "rust1", since = "1.0.0")] | ||
pub struct Difference<'a, T: 'a> { | ||
a: Peekable<Iter<'a, T>>, | ||
b: Peekable<Iter<'a, T>>, | ||
} | ||
|
||
/// A lazy iterator producing elements in the set symmetric difference (in-order). | ||
/// | ||
/// This structure is created by the [`symmetric_difference`] method on |
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.
"symmetric_difference()"
#[stable(feature = "rust1", since = "1.0.0")] | ||
pub struct SymmetricDifference<'a, T: 'a> { | ||
a: Peekable<Iter<'a, T>>, | ||
b: Peekable<Iter<'a, T>>, | ||
} | ||
|
||
/// A lazy iterator producing elements in the set intersection (in-order). | ||
/// | ||
/// This structure is created by the [`intersection`] method on [`BTreeSet`]. |
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.
"intersection()"
#[stable(feature = "rust1", since = "1.0.0")] | ||
pub struct Intersection<'a, T: 'a> { | ||
a: Peekable<Iter<'a, T>>, | ||
b: Peekable<Iter<'a, T>>, | ||
} | ||
|
||
/// A lazy iterator producing elements in the set union (in-order). | ||
/// | ||
/// This structure is created by the [`union`] method on [`BTreeSet`]. |
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.
"union()"
dfd8739
to
4983cce
Compare
Comments have been addressed. |
Thanks! I think one commit would have been more than enough here, but whatever! :p @bors: r+ rollup |
📌 Commit 4983cce has been approved by |
@bors r- Looks like there are link errors |
4983cce
to
a4fcd79
Compare
I think I fixed the links. Will wait for Travis. |
Seems not. ;) |
@GuillaumeGomez Can you find the error in the logs? I can't seem to find it. Maybe I'll force push. |
a4fcd79
to
5ef15ef
Compare
5ef15ef
to
457c282
Compare
Didn't find it either. I restarted the build. |
/// An owning iterator over a `BTreeSet`'s items. | ||
/// | ||
/// This structure is created by the [`into_iter()`] method on [`BTreeSet`] | ||
/// [`BTreeSet`] (provided by the [`IntoIterator`] trait). |
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.
Am I misunderstanding the syntax or are there two BTreeSet
s in a row here?
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.
If one writes:
```rust
[`BTreeSet`] (hello world)
[`BTreeSet`]: https://google.com
```
rustdoc will treat this as a link to the url "https://hello world" which is not what we want. Instead, we have to write
```rust
[`BTreeSet`][`BTreeSet`] (hello world)
[`BTreeSet`]: https://google.com
```
which will link to https://google.com
I don't see any errors, so I'm going to consider the links to be fixed. @bors r=GuillaumeGomez rollup |
📌 Commit 457c282 has been approved by |
…omez Improvements to `BTreeSet` documentation. None
@bors r-
|
⌛ Testing commit b4ed584 with merge 318c412... |
💔 Test failed - auto-mac-64-opt-rustbuild |
You broke the CI again. :p
@bors: r- |
@bors retry |
@bors r=GuillaumeGomez |
📌 Commit b4ed584 has been approved by |
@GuillaumeGomez The error you pasted isn't for my latest commit. |
@bors: r=GuillaumeGomez |
💡 This pull request was already approved, no need to approve it again.
|
📌 Commit b4ed584 has been approved by |
Hm bors doesn't seem to want to move this out of the failed state. I'm going to close and reopen to see if that works. |
@bors: r+ |
💡 This pull request was already approved, no need to approve it again.
|
📌 Commit b4ed584 has been approved by |
@frewsxcv looks like bors is getting confused here unfortunately. Want to |
b4ed584
to
fe0d092
Compare
Done. |
@bors: r+ |
📌 Commit fe0d092 has been approved by |
Looks like that did the trick! |
Improvements to `BTreeSet` documentation. None
Rollup of 29 pull requests - Successful merges: #37761, #38006, #38131, #38150, #38158, #38171, #38208, #38215, #38236, #38245, #38289, #38302, #38315, #38346, #38388, #38395, #38398, #38418, #38432, #38451, #38463, #38468, #38470, #38471, #38472, #38478, #38486, #38493, #38498 - Failed merges: #38271, #38483
No description provided.