rustlings/exercises/strings/strings1.rs
2021-07-07 21:02:31 +01:00

15 lines
365 B
Rust

// strings1.rs
// Make me compile without changing the function signature!
// Execute `rustlings hint strings1` for hints ;)
fn main() {
let answer = current_favorite_color();
println!("My current favorite color is {}", answer);
}
fn current_favorite_color() -> String {
// .to_string uses fmt trait
// .to_owned works too
"blue".to_owned()
}