mirror of
https://github.com/notohh/rustlings.git
synced 2024-11-21 21:42:23 -05:00
Add some more common String/&str idioms
This commit is contained in:
parent
7af29d6211
commit
dbad16021c
1 changed files with 2 additions and 0 deletions
|
@ -10,6 +10,8 @@ fn main() {
|
||||||
("blue");
|
("blue");
|
||||||
("red".to_string());
|
("red".to_string());
|
||||||
(String::from("hi"));
|
(String::from("hi"));
|
||||||
|
("rust is fun!".to_owned());
|
||||||
|
("nice weather".into());
|
||||||
(format!("Interpolation {}", "Station"));
|
(format!("Interpolation {}", "Station"));
|
||||||
(&String::from("abc")[0..1]);
|
(&String::from("abc")[0..1]);
|
||||||
(" hello there ".trim());
|
(" hello there ".trim());
|
||||||
|
|
Loading…
Reference in a new issue