Change Rust version from mutable results to a functional fold.