Skip to content

Commit 8dcee5c

Browse files
bors[bot]japaric
andauthored
Merge #322
322: clarify the iteration order of IndexMap / IndexSet r=japaric a=japaric closes #321 Co-authored-by: Jorge Aparicio <[email protected]>
2 parents df890b1 + fdcfd4c commit 8dcee5c

File tree

2 files changed

+8
-8
lines changed

2 files changed

+8
-8
lines changed

src/indexmap.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -510,7 +510,7 @@ where
510510
N
511511
}
512512

513-
/// Return an iterator over the keys of the map, in their order
513+
/// Return an iterator over the keys of the map, in insertion order
514514
///
515515
/// ```
516516
/// use heapless::FnvIndexMap;
@@ -528,7 +528,7 @@ where
528528
self.core.entries.iter().map(|bucket| &bucket.key)
529529
}
530530

531-
/// Return an iterator over the values of the map, in their order
531+
/// Return an iterator over the values of the map, in insertion order
532532
///
533533
/// ```
534534
/// use heapless::FnvIndexMap;
@@ -546,7 +546,7 @@ where
546546
self.core.entries.iter().map(|bucket| &bucket.value)
547547
}
548548

549-
/// Return an iterator over mutable references to the the values of the map, in their order
549+
/// Return an iterator over mutable references to the the values of the map, in insertion order
550550
///
551551
/// ```
552552
/// use heapless::FnvIndexMap;
@@ -568,7 +568,7 @@ where
568568
self.core.entries.iter_mut().map(|bucket| &mut bucket.value)
569569
}
570570

571-
/// Return an iterator over the key-value pairs of the map, in their order
571+
/// Return an iterator over the key-value pairs of the map, in insertion order
572572
///
573573
/// ```
574574
/// use heapless::FnvIndexMap;
@@ -588,7 +588,7 @@ where
588588
}
589589
}
590590

591-
/// Return an iterator over the key-value pairs of the map, in their order
591+
/// Return an iterator over the key-value pairs of the map, in insertion order
592592
///
593593
/// ```
594594
/// use heapless::FnvIndexMap;

src/indexset.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,7 @@ where
111111
self.map.capacity()
112112
}
113113

114-
/// Return an iterator over the values of the set, in their order
114+
/// Return an iterator over the values of the set, in insertion order
115115
///
116116
/// # Examples
117117
///
@@ -122,7 +122,7 @@ where
122122
/// set.insert("a").unwrap();
123123
/// set.insert("b").unwrap();
124124
///
125-
/// // Will print in an arbitrary order.
125+
/// // Will print in insertion order: a, b
126126
/// for x in set.iter() {
127127
/// println!("{}", x);
128128
/// }
@@ -195,7 +195,7 @@ where
195195
/// let mut a: FnvIndexSet<_, 16> = [1, 2, 3].iter().cloned().collect();
196196
/// let mut b: FnvIndexSet<_, 16> = [4, 2, 3, 4].iter().cloned().collect();
197197
///
198-
/// // Print 1, 4 in that order order.
198+
/// // Print 1, 4 in that order.
199199
/// for x in a.symmetric_difference(&b) {
200200
/// println!("{}", x);
201201
/// }

0 commit comments

Comments
 (0)