Hi Francesco. Thanks for the tutorial! Could you please explain why do you use my_fn_squared and not my_fut_squared in the code below?
my_fn_squared
my_fut_squared
let chained_future = my_fut().and_then(|retval| my_fn_squared(retval));
Hi Andrei, although there is no difference in the result between these two:
let chained_future = my_fut().and_then(|retval| my_fn_squared(retval)); let chained_future = my_fut().and_then(|retval| my_fut_squared(retval));
The signature is different:
futures::AndThen<impl futures::Future, std::result::Result<u32, std::boxed::Box<dyn std::error::Error>>, [closure@src/main.rs:25:45: 25:75]> futures::AndThen<impl futures::Future, impl futures::Future, [closure@src/main.rs:30:45: 30:76]>
That said I think you are right, the code I used in the post is misleading. I will correct it right away!
Thank you very much, Francesco
Are you sure you want to hide this comment? It will become hidden in your post, but will still be visible via the comment's permalink.
Hide child comments as well
Confirm
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
Hi Francesco. Thanks for the tutorial!
Could you please explain why do you use
my_fn_squared
and notmy_fut_squared
in the code below?Hi Andrei,
although there is no difference in the result between these two:
The signature is different:
That said I think you are right, the code I used in the post is misleading. I will correct it right away!
Thank you very much,
Francesco