From e23dad1f4114042ba24fb1749abb91bbf75b3b56 Mon Sep 17 00:00:00 2001 From: Nick Krichevsky Date: Wed, 1 Jun 2022 23:07:47 -0400 Subject: [PATCH] Ensure that stream_new_messages returns something that is Send Makes sure that this can be used on multi-threaded executors Well, technically it doesn't fully guarantee it, but the error being non-Send is very unlikely. Anyway, if the returned Stream is not Send, the future definitely won't be, so we will assert that at least. --- src/lib.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/lib.rs b/src/lib.rs index 3ddb3d3..688eac6 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -59,7 +59,7 @@ impl From for StreamSetupError { pub async fn stream_new_messages( spawner: &S, imap_config: IMAPConfig, -) -> Result>, StreamSetupError> { +) -> Result> + Send, StreamSetupError> { let session_generator_arc = Arc::new(ConfigSessionGenerator::new(imap_config.clone())); let watcher = email::inbox::watch_for_new_messages(spawner, session_generator_arc.clone()) .await