Improving our base example 173 This program is basically the same one we created in Chapter 7, only this time, we create it from our coroutine/wait syntax instead of writing the state machine by hand. Next, we need to transform this into code by using corofy since the compiler doesn't recognize our own coroutine/wait syntax. 1. If you're in the root folder of a-runtime, run corofy. /src/main. rs. 2. Y ou should now have a file that's called main_corofied. rs. 3. Delete the code in main. rs and copy the contents of main_corofied. rs into main. rs. 4. Y ou can now delete main_corofied. rs since we won't need it going forward. If everything is done right, the project structure should now look like this: src |--future. rs |--http. rs |--main. rs |--runtime. rs Tip Y ou can always refer to the book's repository to make sure everything is correct. The correct example is located in the ch08/a-runtime folder. In the repository, you'll also find a file called main_orig. rs in the root folder that contains the coroutine/wait program if you want to rerun it or have problems getting everything working correctly. Design Before we go any further, let's visualize how our system is currently working if we consider it with two futures created by coroutine/wait and two calls to Http::get. The loop that polls our Future trait to completion in the main function takes the role of the executor in our visualization, and as you see, we have a chain of futures consisting of: 1. Non-leaf futures created by async/await (or coroutine/wait in our example) that simply call poll on the next future until it reaches a leaf future 2. Leaf futures that poll an actual source that's either Ready or Not Ready