3 use std
::string
::String
;
5 fn test_stack_assign() {
6 let s
: String
= "a".to_string();
7 println
!("{}", s
.clone());
8 let t
: String
= "a".to_string();
10 let u
: String
= "b".to_string();
14 fn test_heap_lit() { "a big string".to_string(); }
16 fn test_heap_assign() {
17 let s
: String
= "a big ol' string".to_string();
18 let t
: String
= "a big ol' string".to_string();
20 let u
: String
= "a bad ol' string".to_string();
25 let s
= "a big ol' string".to_string();
30 let mut s
= String
::new();
34 let mut s
= String
::from("a");
36 println
!("{}", s
.clone());
39 let mut s
= String
::from("c");
41 assert_eq
!(s
, "coffee");
44 assert_eq
!(s
, "coffee&tea");