Skip to content

Commit

Permalink
Fix variable name in documentation (#2555)
Browse files Browse the repository at this point in the history
A variable name was misspelled in the `filter` and `filter_map` functions documentation.
This replaces `evens` by `events`.
  • Loading branch information
jdrouet authored Feb 6, 2022
1 parent cd1f29a commit ca04ac6
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions futures-util/src/stream/stream/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -404,9 +404,9 @@ pub trait StreamExt: Stream {
/// use futures::stream::{self, StreamExt};
///
/// let stream = stream::iter(1..=10);
/// let evens = stream.filter(|x| future::ready(x % 2 == 0));
/// let events = stream.filter(|x| future::ready(x % 2 == 0));
///
/// assert_eq!(vec![2, 4, 6, 8, 10], evens.collect::<Vec<_>>().await);
/// assert_eq!(vec![2, 4, 6, 8, 10], events.collect::<Vec<_>>().await);
/// # });
/// ```
fn filter<Fut, F>(self, f: F) -> Filter<Self, Fut, F>
Expand Down Expand Up @@ -436,11 +436,11 @@ pub trait StreamExt: Stream {
/// use futures::stream::{self, StreamExt};
///
/// let stream = stream::iter(1..=10);
/// let evens = stream.filter_map(|x| async move {
/// let events = stream.filter_map(|x| async move {
/// if x % 2 == 0 { Some(x + 1) } else { None }
/// });
///
/// assert_eq!(vec![3, 5, 7, 9, 11], evens.collect::<Vec<_>>().await);
/// assert_eq!(vec![3, 5, 7, 9, 11], events.collect::<Vec<_>>().await);
/// # });
/// ```
fn filter_map<Fut, T, F>(self, f: F) -> FilterMap<Self, Fut, F>
Expand Down

0 comments on commit ca04ac6

Please sign in to comment.