Ported to the latest Rust