We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
tokio::task::Builder::spawn()
1 parent c25b09f commit f42ec02Copy full SHA for f42ec02
src/internal/tokio.rs
@@ -6,7 +6,10 @@ where
6
F: Future<Output = T> + Send + 'static,
7
T: Send + 'static,
8
{
9
- tokio::task::Builder::new().name(&*format!("serenity::{}", name)).spawn(future)
+ tokio::task::Builder::new()
10
+ .name(&*format!("serenity::{}", name))
11
+ .spawn(future)
12
+ .expect("called outside tokio runtime")
13
}
14
15
#[cfg(not(all(tokio_unstable, feature = "tokio_task_builder")))]
0 commit comments