Complete strings section
This commit is contained in:
parent
0d99ecb674
commit
948b711fd1
exercises/strings
|
@ -7,7 +7,7 @@ fn main() {
|
||||||
}
|
}
|
||||||
|
|
||||||
fn current_favorite_color() -> String {
|
fn current_favorite_color() -> String {
|
||||||
"blue"
|
String::from("blue")
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -3,7 +3,7 @@
|
||||||
|
|
||||||
fn main() {
|
fn main() {
|
||||||
let word = String::from("green"); // Try not changing this line :)
|
let word = String::from("green"); // Try not changing this line :)
|
||||||
if is_a_color_word(word) {
|
if is_a_color_word(&word) {
|
||||||
println!("That is a color word I know!");
|
println!("That is a color word I know!");
|
||||||
} else {
|
} else {
|
||||||
println!("That is not a color word I know.");
|
println!("That is not a color word I know.");
|
||||||
|
|
Loading…
Reference in a new issue