diff --git a/swiftide/src/ingestion/ingestion_stream.rs b/swiftide/src/ingestion/ingestion_stream.rs index 1feefa15..ea97667c 100644 --- a/swiftide/src/ingestion/ingestion_stream.rs +++ b/swiftide/src/ingestion/ingestion_stream.rs @@ -42,6 +42,15 @@ impl Into for Vec> { } } +impl Into for Result> { + fn into(self) -> IngestionStream { + match self { + Ok(nodes) => IngestionStream::iter(nodes.into_iter().map(Ok)), + Err(err) => IngestionStream::iter(vec![Err(err)]), + } + } +} + impl Into for Pin> + Send>> { fn into(self) -> IngestionStream { IngestionStream { inner: self }