Build an error stream from a non-empty collection. If the collection is empty, panic.
(errors: I)
| 118 | /// Build an error stream from a non-empty collection. |
| 119 | /// If the collection is empty, panic. |
| 120 | pub fn expect_nonempty<I: IntoIterator<Item = E>>(errors: I) -> Self { |
| 121 | let mut errors = errors.into_iter(); |
| 122 | let first = errors.next().expect("expected at least one error"); |
| 123 | let mut stream = Self::from(first); |
| 124 | stream.extend(errors); |
| 125 | stream |
| 126 | } |
| 127 | |
| 128 | /// Add some extra errors to a result. |
| 129 | /// |