Add sort implementation in Rust.