summaryrefslogtreecommitdiff
path: root/strings
diff options
context:
space:
mode:
authorCarol (Nichols || Goulding) <carol.nichols@gmail.com>2015-10-04 11:42:09 -0400
committerCarol (Nichols || Goulding) <carol.nichols@gmail.com>2015-10-04 11:42:09 -0400
commitdbad16021cec2a842f5c8d6b9a28ba2039044cb8 (patch)
treef235d4bfff6b7c915e2198b515ea39931af5f6a6 /strings
parent7af29d6211bbc9ea1018852016fa516d4a112f41 (diff)
Add some more common String/&str idioms
Diffstat (limited to 'strings')
-rw-r--r--strings/strings3.rs2
1 files changed, 2 insertions, 0 deletions
diff --git a/strings/strings3.rs b/strings/strings3.rs
index dbba39d..a4e5775 100644
--- a/strings/strings3.rs
+++ b/strings/strings3.rs
@@ -10,6 +10,8 @@ fn main() {
("blue");
("red".to_string());
(String::from("hi"));
+ ("rust is fun!".to_owned());
+ ("nice weather".into());
(format!("Interpolation {}", "Station"));
(&String::from("abc")[0..1]);
(" hello there ".trim());