Optimized Rust example