Rust Type Inference Advanced Example