Skip to content

Commit f42ec02

Browse files
authored
Unwrap tokio::task::Builder::spawn() to support updated tokio task builder API (#2349)
1 parent c25b09f commit f42ec02

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/internal/tokio.rs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,10 @@ where
66
F: Future<Output = T> + Send + 'static,
77
T: Send + 'static,
88
{
9-
tokio::task::Builder::new().name(&*format!("serenity::{}", name)).spawn(future)
9+
tokio::task::Builder::new()
10+
.name(&*format!("serenity::{}", name))
11+
.spawn(future)
12+
.expect("called outside tokio runtime")
1013
}
1114

1215
#[cfg(not(all(tokio_unstable, feature = "tokio_task_builder")))]

0 commit comments

Comments
 (0)