Skip to content

Commit

Permalink
Swap out Try for Result
Browse files Browse the repository at this point in the history
  • Loading branch information
eopb committed Dec 30, 2020
1 parent 0ff2022 commit 892963e
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions library/core/src/array/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ use crate::convert::{Infallible, TryFrom};
use crate::fmt;
use crate::hash::{self, Hash};
use crate::marker::Unsize;
use crate::ops::{Index, IndexMut, Try};
use crate::ops::{Index, IndexMut};
use crate::slice::{Iter, IterMut};

mod iter;
Expand Down Expand Up @@ -480,10 +480,9 @@ impl<T, const N: usize> [T; N] {
/// assert!(b.is_err());
/// ```
#[unstable(feature = "array_try_map", issue = "79711")]
pub fn try_map<F, R, E, U>(self, mut f: F) -> Result<[U; N], E>
pub fn try_map<F, E, U>(self, mut f: F) -> Result<[U; N], E>
where
F: FnMut(T) -> R,
R: Try<Ok = U, Error = E>,
F: FnMut(T) -> Result<U, E>,
{
use crate::mem::MaybeUninit;
struct Guard<T, const N: usize> {
Expand Down

0 comments on commit 892963e

Please sign in to comment.