- suppose we have:

```
x: Result<T, E>
```

then we can do:

```
x?
```

- Now, suppose instead we have:

```
v: Vec<Result<T, E>>;
```

is there a way to apply ? to the entire Vec? either it returns the first E, or it returns a Vec ?

- suppose we have:

```
x: Result<T, E>
```

then we can do:

```
x?
```

- Now, suppose instead we have:

```
v: Vec<Result<T, E>>;
```

is there a way to apply ? to the entire Vec? either it returns the first E, or it returns a Vec ?

0 Likes

You can use this implementation of FromIterator: `v.into_iter().collect()?`

. But it would be more efficient to do it before you create the initial Vec.

2 Likes