Skip to content

Commit

Permalink
Tweak btree iterator wording to not use 'yield'
Browse files Browse the repository at this point in the history
Yield means something else in the context of generators, which are
sufficiently close to iterators that it's better to avoid the
terminology collision here.
  • Loading branch information
dtolnay committed Jan 16, 2022
1 parent 65d4734 commit ad6408d
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
5 changes: 3 additions & 2 deletions library/alloc/src/collections/btree/map.rs
Original file line number Diff line number Diff line change
Expand Up @@ -65,8 +65,9 @@ pub(super) const MIN_LEN: usize = node::MIN_LEN_AFTER_SPLIT;
/// incorrect results, aborts, memory leaks, or non-termination) but will not be undefined
/// behavior.
///
/// Iterators yielded by functions such as [`BTreeMap::iter`], [`BTreeMap::values`], or [`BTreeMap::keys`]
/// yield their items in order by key, and take worst-case logarithmic and amortized constant time per item yielded.
/// Iterators obtained from functions such as [`BTreeMap::iter`], [`BTreeMap::values`], or
/// [`BTreeMap::keys`] produce their items in order by key, and take worst-case logarithmic and
/// amortized constant time per item returned.
///
/// [B-Tree]: https://en.wikipedia.org/wiki/B-tree
/// [`Cell`]: core::cell::Cell
Expand Down
4 changes: 2 additions & 2 deletions library/alloc/src/collections/btree/set.rs
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,8 @@ use super::Recover;
/// incorrect results, aborts, memory leaks, or non-termination) but will not be undefined
/// behavior.
///
/// Iterators returned by [`BTreeSet::iter`] yield their items in order,
/// and take worst-case logarithmic and amortized constant time per item yielded.
/// Iterators returned by [`BTreeSet::iter`] produce their items in order, and take worst-case
/// logarithmic and amortized constant time per item returned.
///
/// [`Ord`]: core::cmp::Ord
/// [`Cell`]: core::cell::Cell
Expand Down

0 comments on commit ad6408d

Please sign in to comment.