Skip to content

Rollup of 18 pull requests #31148

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 39 commits into from
Jan 23, 2016
Merged
Changes from 1 commit
Commits
Show all changes
39 commits
Select commit Hold shift + click to select a range
0f8fc2c
Improve CStr::from_ptr example in docs
andreabedini Jan 19, 2016
9d77694
Fix type parameter default error to mention type and trait definitions
bluss Jan 18, 2016
796f158
Add test for #30123
brson Jan 19, 2016
ccba72e
Add examples of the Entry API to the HashMap documentation.
nathankleyn Jan 19, 2016
6849b6d
Remove leftover import of `std::str` in doc test
andreabedini Jan 19, 2016
a6778a2
Improve E0317 long diagnostics
Manishearth Jan 20, 2016
132ec2c
Correct code in E0382 explanation
apasel422 Jan 20, 2016
6271ee9
tweak colors for a11y
steveklabnik Jan 20, 2016
5763b86
Add alt tags for logos
steveklabnik Jan 20, 2016
257a1ec
tweak struct colors
steveklabnik Jan 20, 2016
c449f04
tweak trait css
steveklabnik Jan 20, 2016
c158fd9
Add Alexis thesis to bibliography
brson Jan 20, 2016
52c89ee
doc: improve grammar
tshepang Jan 21, 2016
2a7bef6
doc: this sentence did not read well
tshepang Jan 21, 2016
48aa5ef
Fix typo in "Getting Started" section of the book
apasel422 Jan 22, 2016
c94b14a
update link to unwind in book
steveklabnik Jan 22, 2016
9624b68
book: Clarify that trait or type must be in same crate as impl
kamalmarhubi Jan 22, 2016
a559577
Forward reference crates and modules chapter
kamalmarhubi Jan 22, 2016
97f9cad
E0210: Add a warning about type aliases
marcbowes Jan 22, 2016
f81a11b
Document that BTreeMap iteration is in order
mbrubeck Jan 22, 2016
6a6e9a9
Fix the missing line in the guessing-game.md
vessd Jan 23, 2016
e598b43
Rollup merge of #30997 - bluss:trait-default, r=nikomatsakis
steveklabnik Jan 23, 2016
03b4bf2
Rollup merge of #31019 - andreabedini:patch-1, r=alexcrichton
steveklabnik Jan 23, 2016
068fa97
Rollup merge of #31031 - brson:issue-30123, r=nikomatsakis
steveklabnik Jan 23, 2016
97f9e26
Rollup merge of #31035 - nathankleyn:improve-visibility-of-entry-api,…
steveklabnik Jan 23, 2016
82626b1
Rollup merge of #31045 - Manishearth:diag-prim-shadow, r=steveklabnik
steveklabnik Jan 23, 2016
3f56b29
Rollup merge of #31050 - apasel422:issue-31048, r=Manishearth
steveklabnik Jan 23, 2016
2581aac
Rollup merge of #31054 - steveklabnik:a11y, r=alexcrichton
steveklabnik Jan 23, 2016
b1e5af4
Rollup merge of #31055 - steveklabnik:alt-tags, r=alexcrichton
steveklabnik Jan 23, 2016
b4311b7
Rollup merge of #31061 - brson:bib, r=steveklabnik
steveklabnik Jan 23, 2016
9ed27a4
Rollup merge of #31088 - tshepang:grammar, r=brson
steveklabnik Jan 23, 2016
4fcefee
Rollup merge of #31090 - tshepang:improve-sentence, r=brson
steveklabnik Jan 23, 2016
9bc29a9
Rollup merge of #31111 - apasel422:issue-31103, r=steveklabnik
steveklabnik Jan 23, 2016
c9c7549
Rollup merge of #31113 - steveklabnik:master, r=alexcrichton
steveklabnik Jan 23, 2016
fc8ef6c
Rollup merge of #31128 - kamalmarhubi:book-trait-impl-clarify, r=stev…
steveklabnik Jan 23, 2016
9e5c8aa
Rollup merge of #31130 - marcbowes:master, r=nrc
steveklabnik Jan 23, 2016
b0b1df8
Rollup merge of #31136 - mbrubeck:btree-doc, r=steveklabnik
steveklabnik Jan 23, 2016
4d99bad
Rollup merge of #31145 - D101101:patch-1, r=steveklabnik
steveklabnik Jan 23, 2016
feb2673
Rollup merge of #31146 - angelsl:patch-1, r=steveklabnik
steveklabnik Jan 23, 2016
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Document that BTreeMap iteration is in order
Also change the examples to make this more obvious. Fixes #31129.
  • Loading branch information
mbrubeck committed Jan 22, 2016
commit f81a11b7b87cea6fcf7a4d85bdeedfd1725a47f8
20 changes: 10 additions & 10 deletions src/libcollections/btree/map.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1194,17 +1194,17 @@ unsafe fn unwrap_unchecked<T>(val: Option<T>) -> T {
}

impl<K, V> BTreeMap<K, V> {
/// Gets an iterator over the entries of the map.
/// Gets an iterator over the entries of the map, sorted by key.
///
/// # Examples
///
/// ```
/// use std::collections::BTreeMap;
///
/// let mut map = BTreeMap::new();
/// map.insert(1, "a");
/// map.insert(2, "b");
/// map.insert(3, "c");
/// map.insert(2, "b");
/// map.insert(1, "a");
///
/// for (key, value) in map.iter() {
/// println!("{}: {}", key, value);
Expand All @@ -1224,7 +1224,7 @@ impl<K, V> BTreeMap<K, V> {
}
}

/// Gets a mutable iterator over the entries of the map.
/// Gets a mutable iterator over the entries of the map, sorted by key.
///
/// # Examples
///
Expand Down Expand Up @@ -1257,16 +1257,16 @@ impl<K, V> BTreeMap<K, V> {
}
}

/// Gets an iterator over the keys of the map.
/// Gets an iterator over the keys of the map, in sorted order.
///
/// # Examples
///
/// ```
/// use std::collections::BTreeMap;
///
/// let mut a = BTreeMap::new();
/// a.insert(1, "a");
/// a.insert(2, "b");
/// a.insert(1, "a");
///
/// let keys: Vec<_> = a.keys().cloned().collect();
/// assert_eq!(keys, [1, 2]);
Expand All @@ -1276,19 +1276,19 @@ impl<K, V> BTreeMap<K, V> {
Keys { inner: self.iter() }
}

/// Gets an iterator over the values of the map.
/// Gets an iterator over the values of the map, in order by key.
///
/// # Examples
///
/// ```
/// use std::collections::BTreeMap;
///
/// let mut a = BTreeMap::new();
/// a.insert(1, "a");
/// a.insert(2, "b");
/// a.insert(1, "hello");
/// a.insert(2, "goodbye");
///
/// let values: Vec<&str> = a.values().cloned().collect();
/// assert_eq!(values, ["a", "b"]);
/// assert_eq!(values, ["hello", "goodbye"]);
/// ```
#[stable(feature = "rust1", since = "1.0.0")]
pub fn values<'a>(&'a self) -> Values<'a, K, V> {
Expand Down