@@ -1194,17 +1194,17 @@ unsafe fn unwrap_unchecked<T>(val: Option<T>) -> T {
1194
1194
}
1195
1195
1196
1196
impl < K , V > BTreeMap < K , V > {
1197
- /// Gets an iterator over the entries of the map.
1197
+ /// Gets an iterator over the entries of the map, sorted by key .
1198
1198
///
1199
1199
/// # Examples
1200
1200
///
1201
1201
/// ```
1202
1202
/// use std::collections::BTreeMap;
1203
1203
///
1204
1204
/// let mut map = BTreeMap::new();
1205
- /// map.insert(1, "a");
1206
- /// map.insert(2, "b");
1207
1205
/// map.insert(3, "c");
1206
+ /// map.insert(2, "b");
1207
+ /// map.insert(1, "a");
1208
1208
///
1209
1209
/// for (key, value) in map.iter() {
1210
1210
/// println!("{}: {}", key, value);
@@ -1224,7 +1224,7 @@ impl<K, V> BTreeMap<K, V> {
1224
1224
}
1225
1225
}
1226
1226
1227
- /// Gets a mutable iterator over the entries of the map.
1227
+ /// Gets a mutable iterator over the entries of the map, sorted by key .
1228
1228
///
1229
1229
/// # Examples
1230
1230
///
@@ -1257,16 +1257,16 @@ impl<K, V> BTreeMap<K, V> {
1257
1257
}
1258
1258
}
1259
1259
1260
- /// Gets an iterator over the keys of the map.
1260
+ /// Gets an iterator over the keys of the map, in sorted order .
1261
1261
///
1262
1262
/// # Examples
1263
1263
///
1264
1264
/// ```
1265
1265
/// use std::collections::BTreeMap;
1266
1266
///
1267
1267
/// let mut a = BTreeMap::new();
1268
- /// a.insert(1, "a");
1269
1268
/// a.insert(2, "b");
1269
+ /// a.insert(1, "a");
1270
1270
///
1271
1271
/// let keys: Vec<_> = a.keys().cloned().collect();
1272
1272
/// assert_eq!(keys, [1, 2]);
@@ -1276,19 +1276,19 @@ impl<K, V> BTreeMap<K, V> {
1276
1276
Keys { inner : self . iter ( ) }
1277
1277
}
1278
1278
1279
- /// Gets an iterator over the values of the map.
1279
+ /// Gets an iterator over the values of the map, in order by key .
1280
1280
///
1281
1281
/// # Examples
1282
1282
///
1283
1283
/// ```
1284
1284
/// use std::collections::BTreeMap;
1285
1285
///
1286
1286
/// let mut a = BTreeMap::new();
1287
- /// a.insert(1, "a ");
1288
- /// a.insert(2, "b ");
1287
+ /// a.insert(1, "hello ");
1288
+ /// a.insert(2, "goodbye ");
1289
1289
///
1290
1290
/// let values: Vec<&str> = a.values().cloned().collect();
1291
- /// assert_eq!(values, ["a ", "b "]);
1291
+ /// assert_eq!(values, ["hello ", "goodbye "]);
1292
1292
/// ```
1293
1293
#[ stable( feature = "rust1" , since = "1.0.0" ) ]
1294
1294
pub fn values < ' a > ( & ' a self ) -> Values < ' a , K , V > {
0 commit comments