Stdle #150 · classes · 2026-11-03
What does this Rust snippet output?
A past puzzle — fully playable. 4 attempts, hints on wrong guesses.
fn first<T: Clone>(v: &[T]) -> T { v[0].clone()}fn main() { let nums = [10, 20, 30]; let words = ["a", "b"]; println!("{}", first(&nums)); println!("{}", first(&words));}Classes