String processing algorithms in Rust