diff --git a/exercises/09_strings/strings1.rs b/exercises/09_strings/strings1.rs index de762ebf..6abdbb48 100644 --- a/exercises/09_strings/strings1.rs +++ b/exercises/09_strings/strings1.rs @@ -1,10 +1,9 @@ -// Make me compile without changing the function signature! - -fn main() { - let answer = current_favorite_color(); - println!("My current favorite color is {}", answer); -} - +// TODO: Fix the compiler error without changing the function signature. fn current_favorite_color() -> String { "blue" } + +fn main() { + let answer = current_favorite_color(); + println!("My current favorite color is {answer}"); +} diff --git a/solutions/09_strings/strings1.rs b/solutions/09_strings/strings1.rs index 4e181989..f7ba8114 100644 --- a/solutions/09_strings/strings1.rs +++ b/solutions/09_strings/strings1.rs @@ -1 +1,9 @@ -// Solutions will be available before the stable release. Thank you for testing the beta version 🥰 +fn current_favorite_color() -> String { + // Equivalent to `String::from("blue")` + "blue".to_string() +} + +fn main() { + let answer = current_favorite_color(); + println!("My current favorite color is {answer}"); +}