Skip to content

Commit fb98975

Browse files
committed
improved doc example
1 parent 82b6b10 commit fb98975

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

library/core/src/iter/traits/iterator.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4073,7 +4073,7 @@ pub trait Iterator {
40734073
/// Example:
40744074
/// ```
40754075
/// #![feature(iter_contains)]
4076-
/// assert!([1, 2, 3].iter().contains(&1));
4076+
/// assert!([1, 2, 3].iter().map(|&x| x * 3).contains(&6));
40774077
/// assert!(![1, 2, 3].iter().contains(&4));
40784078
/// // You can check if a String is in a string slice iterator.
40794079
/// assert!(["a", "b", "c"].iter().contains(&"b".to_owned()));

0 commit comments

Comments
 (0)