From c4d4448745f4065ea4f4f86d21faca6cf55dd696 Mon Sep 17 00:00:00 2001 From: timofey Date: Mon, 13 May 2024 21:07:02 +0300 Subject: [PATCH] doubly_futures --- src/model_03.rs | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/model_03.rs b/src/model_03.rs index a054a4e..25b1e81 100644 --- a/src/model_03.rs +++ b/src/model_03.rs @@ -271,3 +271,12 @@ fn with_futures() { let x = futures::executor::block_on(x.into_future_()).into_::(); assert_eq!(x, 10); } + +#[test] +fn doubly_futures() { + type U = Composition; + let x = generic_test::(); + let x = futures::executor::block_on(async { x.into_future_().await.into_future_().await }) + .into_::(); + assert_eq!(x, 10); +}