summaryrefslogtreecommitdiff
path: root/rustlings/solutions/09_strings/strings1.rs
diff options
context:
space:
mode:
authorHunter Kvalevog <hunter@kvog.sh>2026-09-19 17:59:40 -0500
committerHunter Kvalevog <hunter@kvog.sh>2026-09-19 17:59:40 -0500
commit038b56dc102e16409823f29e483b165cd1c43178 (patch)
treea1ebc08fc4b3a07751d11b08f8f1ef95da916a9a /rustlings/solutions/09_strings/strings1.rs
parent2186d3558cb5dbe9b8712b9ad2204527b9ee70fc (diff)
rustlings: complete 09
Diffstat (limited to 'rustlings/solutions/09_strings/strings1.rs')
-rw-r--r--rustlings/solutions/09_strings/strings1.rs9
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}");
}