diff options
| author | Hunter Kvalevog <hunter@kvog.sh> | 2026-09-19 17:59:40 -0500 |
|---|---|---|
| committer | Hunter Kvalevog <hunter@kvog.sh> | 2026-09-19 17:59:40 -0500 |
| commit | 7fbdb1bf864c688d247ea9314627064627643fc6 (patch) | |
| tree | a1ebc08fc4b3a07751d11b08f8f1ef95da916a9a /rustlings/solutions/09_strings/strings1.rs | |
| parent | 0675822a60f0873fe1644f7524e7d4c8936e4047 (diff) | |
| download | demos-7fbdb1bf864c688d247ea9314627064627643fc6.tar.gz demos-7fbdb1bf864c688d247ea9314627064627643fc6.zip | |
Diffstat (limited to 'rustlings/solutions/09_strings/strings1.rs')
| -rw-r--r-- | rustlings/solutions/09_strings/strings1.rs | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/rustlings/solutions/09_strings/strings1.rs b/rustlings/solutions/09_strings/strings1.rs index dcf2377..f7ba811 100644 --- a/rustlings/solutions/09_strings/strings1.rs +++ b/rustlings/solutions/09_strings/strings1.rs @@ -1,4 +1,9 @@ +fn current_favorite_color() -> String { + // Equivalent to `String::from("blue")` + "blue".to_string() +} + fn main() { - // DON'T EDIT THIS SOLUTION FILE! - // It will be automatically filled after you finish the exercise. + let answer = current_favorite_color(); + println!("My current favorite color is {answer}"); } |
