Modified to work with the latest Rust