← Back to archive

Stdle #136 · strings · 2026-10-20

What does this Rust snippet output?

A past puzzle — fully playable. 4 attempts, hints on wrong guesses.

fn show(s: &str) -> usize { s.len() }
fn main() {
let owned = String::from("hello");
println!("{}", show(&owned));
}
Strings
4 attempts left

Answer & explanation