We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
[T; N]::try_map
1 parent b5b1356 commit d09382eCopy full SHA for d09382e
library/core/src/array/mod.rs
@@ -533,11 +533,12 @@ impl<T, const N: usize> [T; N] {
533
/// assert_eq!(c, Some(a));
534
/// ```
535
#[unstable(feature = "array_try_map", issue = "79711")]
536
- pub fn try_map<F, R>(self, f: F) -> ChangeOutputType<R, [R::Output; N]>
+ pub fn try_map<R: Try>(
537
+ self,
538
+ f: impl FnMut(T) -> R,
539
+ ) -> <R::Residual as Residual<[R::Output; N]>>::TryType
540
where
- F: FnMut(T) -> R,
- R: Try,
- R::Residual: Residual<[R::Output; N]>,
541
+ R: Try<Residual: Residual<[R::Output; N]>>,
542
{
543
drain_array_with(self, |iter| try_from_trusted_iterator(iter.map(f)))
544
}
0 commit comments