Update code for new Rust version