MCPcopy Create free account
hub / github.com/clockworklabs/SpacetimeDB / expect_nonempty

Method expect_nonempty

crates/data-structures/src/error_stream.rs:120–126  ·  view source on GitHub ↗

Build an error stream from a non-empty collection. If the collection is empty, panic.

(errors: I)

Source from the content-addressed store, hash-verified

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 ///

Callers

nothing calls this directly

Calls 3

into_iterMethod · 0.45
nextMethod · 0.45
extendMethod · 0.45

Tested by

no test coverage detected