Skip to content
/ rust Public
forked from rust-lang/rust

Commit b74d8db

Browse files
committed
Fix example.
1 parent 0c474ac commit b74d8db

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

Diff for: library/core/src/iter/traits/iterator.rs

+4-3
Original file line numberDiff line numberDiff line change
@@ -2967,12 +2967,13 @@ pub trait Iterator {
29672967
/// assert!(result.is_err());
29682968
/// ```
29692969
///
2970-
/// This also supports other types which implement `Try`, not just `Result`.
2970+
/// This also supports other types which implement [`Try`], not just [`Result`].
2971+
///
29712972
/// ```
29722973
/// #![feature(generic_nonzero, try_find)]
2973-
///
29742974
/// use std::num::NonZero;
2975-
/// let a = [3, 5, 7, 4, 9, 0, 11];
2975+
///
2976+
/// let a = [3, 5, 7, 4, 9, 0, 11u32];
29762977
/// let result = a.iter().try_find(|&&x| NonZero::new(x).map(|y| y.is_power_of_two()));
29772978
/// assert_eq!(result, Some(Some(&4)));
29782979
/// let result = a.iter().take(3).try_find(|&&x| NonZero::new(x).map(|y| y.is_power_of_two()));

0 commit comments

Comments
 (0)