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

Improvements to BTreeSet documentation. #38208

Merged
merged 4 commits into from
Dec 21, 2016
Merged

Conversation

frewsxcv
Copy link
Member

@frewsxcv frewsxcv commented Dec 7, 2016

No description provided.

@frewsxcv
Copy link
Member Author

frewsxcv commented Dec 7, 2016

r? @GuillaumeGomez @Ms2ger

Copy link
Member

@GuillaumeGomez GuillaumeGomez left a 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.
Copy link
Member

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`].
Copy link
Member

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

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`].
Copy link
Member

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`].
Copy link
Member

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

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`].
Copy link
Member

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`].
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"union()"

@frewsxcv
Copy link
Member Author

frewsxcv commented Dec 7, 2016

Comments have been addressed.

@GuillaumeGomez
Copy link
Member

Thanks! I think one commit would have been more than enough here, but whatever! :p

@bors: r+ rollup

@bors
Copy link
Contributor

bors commented Dec 7, 2016

📌 Commit 4983cce has been approved by GuillaumeGomez

@frewsxcv
Copy link
Member Author

frewsxcv commented Dec 7, 2016

@bors r-

Looks like there are link errors

@frewsxcv
Copy link
Member Author

frewsxcv commented Dec 7, 2016

I think I fixed the links. Will wait for Travis.

@GuillaumeGomez
Copy link
Member

Seems not. ;)

@frewsxcv
Copy link
Member Author

frewsxcv commented Dec 7, 2016

@GuillaumeGomez Can you find the error in the logs? I can't seem to find it. Maybe I'll force push.

bors added a commit that referenced this pull request Dec 7, 2016
Rollup of 9 pull requests

- Successful merges: #38085, #38123, #38151, #38153, #38158, #38163, #38186, #38189, #38208
- Failed merges:
@GuillaumeGomez
Copy link
Member

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).
Copy link
Contributor

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 BTreeSets in a row here?

Copy link
Member Author

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

@frewsxcv
Copy link
Member Author

frewsxcv commented Dec 9, 2016

I don't see any errors, so I'm going to consider the links to be fixed.

@bors r=GuillaumeGomez rollup

@bors
Copy link
Contributor

bors commented Dec 9, 2016

📌 Commit 457c282 has been approved by GuillaumeGomez

frewsxcv added a commit to frewsxcv/rust that referenced this pull request Dec 12, 2016
…omez

Improvements to `BTreeSet` documentation.

None
@frewsxcv
Copy link
Member Author

@bors r-

Linkcheck stage2 (x86_64-pc-windows-msvc)
collections\btree_set\struct.IntoIter.html:53: broken link - iter\trait.IntoIterator.html
collections\btree_set\struct.IntoIter.html:53: broken link - iter\trait.IntoIterator.html

@bors
Copy link
Contributor

bors commented Dec 16, 2016

⌛ Testing commit b4ed584 with merge 318c412...

@bors
Copy link
Contributor

bors commented Dec 16, 2016

💔 Test failed - auto-mac-64-opt-rustbuild

@GuillaumeGomez
Copy link
Member

GuillaumeGomez commented Dec 16, 2016

You broke the CI again. :p

failures:

---- hash::BuildHasherDefault_0 stdout ----
	error[E0412]: type name `SomeHasher` is undefined or not in scope
  --> <anon>:22:41
   |
22 | type MyBuildHasher = BuildHasherDefault<SomeHasher>;
   |                                         ^^^^^^^^^^ undefined or not in scope
   |
   = help: no candidates by the name of `SomeHasher` found in your project; maybe you misspelled the name or forgot to import an external crate?

error[E0412]: type name `SomeBuidHasher` is undefined or not in scope
  --> <anon>:24:36
   |
24 | let hash_map = HashMap::<u32, u32, SomeBuidHasher>::default();
   |                                    ^^^^^^^^^^^^^^ undefined or not in scope
   |
   = help: no candidates by the name of `SomeBuidHasher` found in your project; maybe you misspelled the name or forgot to import an external crate?

error: aborting due to previous error(s)

thread 'hash::BuildHasherDefault_0' panicked at 'Box<Any>', C:\bot\slave\auto-win-msvc-32-opt\build\src\librustc\session/mod.rs:201
note: Run with `RUST_BACKTRACE=1` for a backtrace.


failures:
    hash::BuildHasherDefault_0

test result: FAILED. 1074 passed; 1 failed; 12 ignored; 0 measured

@bors: r-

@frewsxcv
Copy link
Member Author

@bors retry

@frewsxcv
Copy link
Member Author

@bors r=GuillaumeGomez

@bors
Copy link
Contributor

bors commented Dec 19, 2016

📌 Commit b4ed584 has been approved by GuillaumeGomez

@frewsxcv
Copy link
Member Author

@GuillaumeGomez The error you pasted isn't for my latest commit.

@alexcrichton
Copy link
Member

@bors: r=GuillaumeGomez

@bors
Copy link
Contributor

bors commented Dec 20, 2016

💡 This pull request was already approved, no need to approve it again.

@bors
Copy link
Contributor

bors commented Dec 20, 2016

📌 Commit b4ed584 has been approved by GuillaumeGomez

@alexcrichton
Copy link
Member

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.

@alexcrichton
Copy link
Member

@bors: r+

@bors
Copy link
Contributor

bors commented Dec 20, 2016

💡 This pull request was already approved, no need to approve it again.

@bors
Copy link
Contributor

bors commented Dec 20, 2016

📌 Commit b4ed584 has been approved by alexcrichton

@alexcrichton
Copy link
Member

@frewsxcv looks like bors is getting confused here unfortunately. Want to commit --amend and force push the most recent commit to generate a new commit sha? I think that'll kick bors into seeing something different and re-approving.

@frewsxcv
Copy link
Member Author

Done.

@alexcrichton
Copy link
Member

@bors: r+

@bors
Copy link
Contributor

bors commented Dec 20, 2016

📌 Commit fe0d092 has been approved by alexcrichton

@alexcrichton
Copy link
Member

Looks like that did the trick!

alexcrichton added a commit to alexcrichton/rust that referenced this pull request Dec 20, 2016
Improvements to `BTreeSet` documentation.

None
bors added a commit that referenced this pull request Dec 20, 2016
@bors bors merged commit fe0d092 into rust-lang:master Dec 21, 2016
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.

5 participants