fixup! Use explicit return statement TaskStorage::spawn

This commit is contained in:
Daniel Bevenius 2022-05-04 16:31:52 +02:00
parent 34493c7ed6
commit 0ce29ca84c

View File

@ -165,7 +165,7 @@ impl<F: Future + 'static> TaskStorage<F> {
/// on a different executor.
pub fn spawn(&'static self, future: impl FnOnce() -> F) -> SpawnToken<impl Sized> {
if self.spawn_mark_used() {
return unsafe { SpawnToken::<F>::new(self.spawn_initialize(future)) }
return unsafe { SpawnToken::<F>::new(self.spawn_initialize(future)) };
}
SpawnToken::<F>::new_failed()