finish quiz2
This commit is contained in:
parent
220225d70d
commit
3d6fb762ae
|
@ -7,8 +7,6 @@
|
||||||
// you think each value is. That is, add either `string_slice` or `string`
|
// you think each value is. That is, add either `string_slice` or `string`
|
||||||
// before the parentheses on each line. If you're right, it will compile!
|
// before the parentheses on each line. If you're right, it will compile!
|
||||||
|
|
||||||
// I AM NOT DONE
|
|
||||||
|
|
||||||
fn string_slice(arg: &str) {
|
fn string_slice(arg: &str) {
|
||||||
println!("{}", arg);
|
println!("{}", arg);
|
||||||
}
|
}
|
||||||
|
@ -17,14 +15,14 @@ fn string(arg: String) {
|
||||||
}
|
}
|
||||||
|
|
||||||
fn main() {
|
fn main() {
|
||||||
("blue");
|
string_slice("blue");
|
||||||
("red".to_string());
|
string("red".to_string());
|
||||||
(String::from("hi"));
|
string(String::from("hi"));
|
||||||
("rust is fun!".to_owned());
|
string("rust is fun!".to_owned());
|
||||||
("nice weather".into());
|
string_slice("nice weather".into());
|
||||||
(format!("Interpolation {}", "Station"));
|
string(format!("Interpolation {}", "Station"));
|
||||||
(&String::from("abc")[0..1]);
|
string_slice(&String::from("abc")[0..1]);
|
||||||
(" hello there ".trim());
|
string_slice(" hello there ".trim());
|
||||||
("Happy Monday!".to_string().replace("Mon", "Tues"));
|
string("Happy Monday!".to_string().replace("Mon", "Tues"));
|
||||||
("mY sHiFt KeY iS sTiCkY".to_lowercase());
|
string("mY sHiFt KeY iS sTiCkY".to_lowercase());
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue