Skip to content
Closed
Changes from 2 commits
Commits
Show all changes
41 commits
Select commit Hold shift + click to select a range
18ad5a5
Add a regression test for issue-72793
JohnTitor Aug 19, 2020
aa40c02
Unstable Book: add links to tracking issues for FFI features
ArekPiekarz Aug 26, 2020
f03d0b3
`impl Rc::new_cyclic`
mental32 Aug 27, 2020
42fb270
typo
mental32 Aug 29, 2020
bb5e79c
Link vec doc to & reference
pickfire Aug 29, 2020
20a6866
Try removing [prim@reference]
pickfire Aug 30, 2020
81e85ce
Move to Arc::clone(&x) over x.clone() in library/std
poliorcetics Aug 30, 2020
6b75e3d
Move to Arc::clone(&x) over x.clone() in library/core
poliorcetics Aug 30, 2020
0f301e8
Removed [inline] and copied over comments from Arc::new_cyclic
mental32 Sep 1, 2020
dddc5ff
rename MaybeUninit slice methods
RalfJung Sep 1, 2020
0e0a47d
document remaining unsafety in maybe_uninit.rs
RalfJung Sep 2, 2020
acac5c6
Add regression test
JulianKnodt Sep 2, 2020
8783c62
Add missing link in README
camelid Sep 2, 2020
3e29fdb
Remove a number of vec UI tests, make them unit tests in the alloc li…
CraftSpider Sep 3, 2020
791f93c
Allow try blocks as the argument to return expressions
scottmcm Sep 3, 2020
4231fbc
Condense StringReader's API to a single function
matklad Sep 3, 2020
4df6490
Link & primitive using relative link
pickfire Sep 3, 2020
ccf41dd
Rename IsJoint -> Spacing
matklad Sep 3, 2020
c6ab3ff
Add test for checking if-let or-patterns
JulianKnodt Aug 16, 2020
2278c72
Remove vec-to_str.rs, merge the remaining test in with vec
CraftSpider Sep 3, 2020
a2e077e
Make `Ipv4Addr` and `Ipv6Addr` const tests unit tests under `library`
CDirkx Sep 3, 2020
8c93125
Address review comments on `Peekable::next_if`
jyn514 Sep 3, 2020
7b823df
Link to `#capacity-and-reallocation` when using with_capacity
jyn514 Sep 3, 2020
538e198
Move various ui const tests to `library`
CDirkx Sep 4, 2020
85146b9
Add slice primitive link to vec
pickfire Sep 4, 2020
1893161
Rollup merge of #75580 - JulianKnodt:or_pattern, r=wesleywiser
matklad Sep 4, 2020
23c6435
Rollup merge of #75695 - JohnTitor:regression-test, r=Dylan-DPC
matklad Sep 4, 2020
ab1e517
Rollup merge of #75954 - ArekPiekarz:unstable_book_ffi_tracking_issue…
matklad Sep 4, 2020
621605f
Rollup merge of #75994 - mental32:impl-rc-new-cyclic, r=KodrAus
matklad Sep 4, 2020
f199602
Rollup merge of #76060 - pickfire:patch-12, r=jyn514
matklad Sep 4, 2020
5734041
Rollup merge of #76128 - poliorcetics:doc-use-arc-clone, r=KodrAus
matklad Sep 4, 2020
c191b36
Rollup merge of #76217 - RalfJung:maybe-uninit-slice, r=KodrAus
matklad Sep 4, 2020
149d339
Rollup merge of #76229 - camelid:patch-3, r=jonas-schievink
matklad Sep 4, 2020
0f9bbea
Rollup merge of #76257 - JulianKnodt:i75777, r=Dylan-DPC
matklad Sep 4, 2020
602babc
Rollup merge of #76273 - CraftSpider:master, r=matklad
matklad Sep 4, 2020
8155dd4
Rollup merge of #76274 - scottmcm:fix-76271, r=petrochenkov
matklad Sep 4, 2020
3ea07a3
Rollup merge of #76291 - matklad:spacing, r=petrochenkov
matklad Sep 4, 2020
405de83
Rollup merge of #76299 - CDirkx:ip-tests, r=matklad
matklad Sep 4, 2020
c40f193
Rollup merge of #76302 - jyn514:peekable-2, r=Dylan-DPC
matklad Sep 4, 2020
3b0e366
Rollup merge of #76303 - jyn514:vec-assert-doc, r=Dylan-DPC
matklad Sep 4, 2020
7758c4d
Rollup merge of #76305 - CDirkx:const-tests, r=matklad
matklad Sep 4, 2020
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
10 changes: 5 additions & 5 deletions library/core/src/iter/adapters/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1772,7 +1772,7 @@ impl<I: Iterator> Peekable<I> {
self.peeked.get_or_insert_with(|| iter.next()).as_ref()
}

/// Consume the next value of this iterator if a condition is true.
/// Consume and return the next value of this iterator if a condition is true.
///
/// If `func` returns `true` for the next value of this iterator, consume and return it.
/// Otherwise, return `None`.
Expand Down Expand Up @@ -1812,7 +1812,7 @@ impl<I: Iterator> Peekable<I> {
}
}

/// Consume the next item if it is equal to `expected`.
/// Consume and return the next item if it is equal to `expected`.
///
/// # Example
/// Consume a number if it's equal to 0.
Expand All @@ -1827,10 +1827,10 @@ impl<I: Iterator> Peekable<I> {
/// assert_eq!(iter.next(), Some(1));
/// ```
#[unstable(feature = "peekable_next_if", issue = "72480")]
pub fn next_if_eq<R>(&mut self, expected: &R) -> Option<I::Item>
pub fn next_if_eq<T>(&mut self, expected: &T) -> Option<I::Item>
where
R: ?Sized,
I::Item: PartialEq<R>,
T: ?Sized,
I::Item: PartialEq<T>,
{
self.next_if(|next| next == expected)
}
Expand Down