here is with reference, so it can be called more than once

This commit is contained in:
Vincent Batts 2023-01-16 19:31:09 -05:00
parent b0c18ed28b
commit ecf2317a5b
30 changed files with 3 additions and 2 deletions

View file

@ -1,8 +1,9 @@
fn say_hello(name: String) { fn say_hello(name: &str) {
println!("{}", name); println!("{}", name);
} }
fn main() { fn main() {
let name = String::from("alice"); let name = String::from("alice");
say_hello(name); say_hello(&name);
say_hello(&name);
} }

Binary file not shown.