Skip to content
Closed
Changes from 2 commits
Commits
Show all changes
41 commits
Select commit Hold shift + click to select a range
fcf1571
Add Atomic*::from_mut.
m-ou-se Jul 19, 2020
09fff5f
Disable Atomic*::from_mut when alignment is wrong.
m-ou-se Aug 13, 2020
8142457
Update tracking issue for const_caller_location
ArekPiekarz Aug 31, 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
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
a3ee65f
Remove a useless allowed attr
tesuji Sep 4, 2020
8f11127
time.rs: Make spelling of "Darwin" consistent
numbermaniac Sep 4, 2020
fac2726
Use ops::ControlFlow in graph::iterate
scottmcm Sep 4, 2020
d16bbd1
Move Vec slice UI tests in library
Sep 4, 2020
8f2d906
Implementation of incompatible features error
Amjad50 Sep 3, 2020
2ed1a21
add some intra-doc links to `Iterator`
euclio Sep 4, 2020
59e3733
Add `BREAK` too, and improve the comments
scottmcm Sep 4, 2020
dfd219d
Indent a note to make folding work nicer
tesuji Sep 5, 2020
7cc2569
Add tracking issue number for atomic_from_mut.
m-ou-se Sep 5, 2020
8af85fa
Improve the documentation of `filter()` and `filter_map()`.
vext01 Aug 26, 2020
7cbfbd3
compiletest: Introduce "min-cdb-version"
MaulingMonkey Sep 5, 2020
4046f92
debuginfo: Ignore HashMap tests before cdb 10.0.18362.1
MaulingMonkey Sep 5, 2020
099af05
Rollup merge of #74532 - fusion-engineering-forks:atomic-from-mut, r=…
Dylan-DPC Sep 6, 2020
8abb528
Rollup merge of #75949 - vext01:filter-docs, r=jyn514
Dylan-DPC Sep 6, 2020
bdd3b05
Rollup merge of #76157 - ArekPiekarz:const_caller_location_tracking_i…
Dylan-DPC Sep 6, 2020
de3e0a6
Rollup merge of #76229 - camelid:patch-3, r=jonas-schievink
Dylan-DPC Sep 6, 2020
26b67dd
Rollup merge of #76273 - CraftSpider:master, r=matklad
Dylan-DPC Sep 6, 2020
3e0a83c
Rollup merge of #76274 - scottmcm:fix-76271, r=petrochenkov
Dylan-DPC Sep 6, 2020
5d24dd0
Rollup merge of #76287 - lzutao:rm-allowed, r=jyn514
Dylan-DPC Sep 6, 2020
a979810
Rollup merge of #76293 - Amjad50:incompatible_features_error, r=lcnr
Dylan-DPC Sep 6, 2020
2d5f21d
Rollup merge of #76299 - CDirkx:ip-tests, r=matklad
Dylan-DPC Sep 6, 2020
f06c59e
Rollup merge of #76302 - jyn514:peekable-2, r=Dylan-DPC
Dylan-DPC Sep 6, 2020
7d9d348
Rollup merge of #76303 - jyn514:vec-assert-doc, r=Dylan-DPC
Dylan-DPC Sep 6, 2020
bdd9561
Rollup merge of #76305 - CDirkx:const-tests, r=matklad
Dylan-DPC Sep 6, 2020
4782725
Rollup merge of #76309 - lzutao:indent-note, r=jyn514
Dylan-DPC Sep 6, 2020
eb02832
Rollup merge of #76312 - numbermaniac:patch-1, r=shepmaster
Dylan-DPC Sep 6, 2020
97cd85d
Rollup merge of #76318 - scottmcm:one-control-flow, r=ecstatic-morse
Dylan-DPC Sep 6, 2020
378274b
Rollup merge of #76324 - ayushmishra2005:move_vec_tests_in_library, r…
Dylan-DPC Sep 6, 2020
d80185b
Rollup merge of #76338 - euclio:intra-link-iterator, r=jyn514
Dylan-DPC Sep 6, 2020
caaf743
Rollup merge of #76390 - MaulingMonkey:pr-min-cdb-version, r=petroche…
Dylan-DPC Sep 6, 2020
File filter

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 8 additions & 18 deletions library/core/src/iter/traits/iterator.rs
Original file line number Diff line number Diff line change
Expand Up @@ -648,11 +648,9 @@ pub trait Iterator {
/// Creates an iterator which uses a closure to determine if an element
/// should be yielded.
///
/// The closure must return `true` or `false`. `filter()` creates an
/// iterator which calls this closure on each element. If the closure
/// returns `true`, then the element is returned. If the closure returns
/// `false`, it will try again, and call the closure on the next element,
/// seeing if it passes the test.
/// Given an element the closure must return `true` or `false`. The returned
/// iterator will yield only the elements for which the closure returns
/// true.
///
/// # Examples
///
Expand Down Expand Up @@ -719,24 +717,16 @@ pub trait Iterator {

/// Creates an iterator that both filters and maps.
///
/// The closure must return an [`Option<T>`]. `filter_map` creates an
/// iterator which calls this closure on each element. If the closure
/// returns [`Some(element)`][`Some`], then that element is returned. If the
/// closure returns [`None`], it will try again, and call the closure on the
/// next element, seeing if it will return [`Some`].
/// The returned iterator yields only the `value`s for which the supplied
/// closure returns `Some(value)`.
///
/// Why `filter_map` and not just [`filter`] and [`map`]? The key is in this
/// part:
/// `filter_map` can be used to make chains of [`filter`] and [`map`] more
/// concise. The example below shows how a `map().filter().map()` can be
/// shortened to a single call to `filter_map`.
///
/// [`filter`]: Iterator::filter
/// [`map`]: Iterator::map
///
/// > If the closure returns [`Some(element)`][`Some`], then that element is returned.
///
/// In other words, it removes the [`Option<T>`] layer automatically. If your
/// mapping is already returning an [`Option<T>`] and you want to skip over
/// [`None`]s, then `filter_map` is much, much nicer to use.
///
/// # Examples
///
/// Basic usage:
Expand Down