test: mark Spawn as #[must_use] (#6371)

This commit is contained in:
kim / Motoyuki Kimura
2024-03-04 16:56:40 +01:00
committed by GitHub
parent f5ca423bf1
commit f6d061919f
+1
View File
@@ -49,6 +49,7 @@ pub fn spawn<T>(task: T) -> Spawn<T> {
/// Future spawned on a mock task that can be used to poll the future or stream
/// without needing pinning or context types.
#[derive(Debug)]
#[must_use = "futures do nothing unless you `.await` or poll them"]
pub struct Spawn<T> {
task: MockTask,
future: Pin<Box<T>>,