|
|
Subscribe / Log in / New account

Discarding return value, and ignoring return type

Discarding return value, and ignoring return type

Posted Sep 25, 2025 8:57 UTC (Thu) by taladar (subscriber, #68407)
In reply to: Discarding return value, and ignoring return type by proski
Parent article: Canceling asynchronous Rust

Ignoring futures could be useful in unit tests where you only want to test the function creating the future in one test and the future itself in the next one.


to post comments

Discarding return value, and ignoring return type

Posted Sep 25, 2025 21:26 UTC (Thu) by intgr (subscriber, #39733) [Link]

I think in that case writing `drop(create_future())` would make the intention clearer than assigning to _


Copyright © 2025, Eklektix, Inc.
Comments and public postings are copyrighted by their creators.
Linux is a registered trademark of Linus Torvalds