Improving our base example 177 Changing the current implementation Now that we have an overview of our design and know what to do, we can go on and make the necessary changes to our program, so let's go through each file we need to change. We'll start with main. rs. main. rs We already made some changes to main. rs when we ran corofy on our updated coroutine/ wait example. I'll just point out the change here so that you don't miss it since there is really nothing more we need to change here. Instead of polling the future in the main function, we created a new Runtime struct and passed the future as an argument to the Runtime::block_on method. There are no more changes that we need to in this file. Our main function changed to this: ch08/a-runtime/src/main. rs fn main() { let future = async_main(); let mut runtime = Runtime::new(); runtime. block_on(future); } The logic we had in the main function has now moved into the runtime module, and that's also where we need to change the code that polls the future to completion from what we had earlier. The next step will, therefore, be to open runtime. rs. runtime. rs The first thing we do in runtime. rs is pull in the dependencies we need: ch08/a-runtime/src/runtime. rs use crate::future::{Future, Poll State}; use mio::{Events, Poll, Registry}; use std::sync::Once Lock;