(
results: impl IntoIterator<Item = Result<T, E>>,
)
| 212 | } |
| 213 | |
| 214 | pub(crate) fn collect_until_error<T, E>( |
| 215 | results: impl IntoIterator<Item = Result<T, E>>, |
| 216 | ) -> Vec<Result<T, E>> { |
| 217 | let mut collected = Vec::new(); |
| 218 | for result in results { |
| 219 | let failed = result.is_err(); |
| 220 | collected.push(result); |
| 221 | if failed { |
| 222 | break; |
| 223 | } |
| 224 | } |
| 225 | collected |
| 226 | } |
| 227 | |
| 228 | pub(crate) fn try_is_present<T, E>( |
| 229 | mut results: impl Iterator<Item = Result<T, E>>, |