@@ -7,9 +7,9 @@ fn check_cow_add_cow() {
77 let borrowed2 = Cow :: Borrowed ( "World!" ) ;
88 let borrow_empty = Cow :: Borrowed ( "" ) ;
99
10- let owned1: Cow < str > = Cow :: Owned ( String :: from ( "Hi, " ) ) ;
11- let owned2: Cow < str > = Cow :: Owned ( String :: from ( "Rustaceans!" ) ) ;
12- let owned_empty: Cow < str > = Cow :: Owned ( String :: new ( ) ) ;
10+ let owned1: Cow < ' _ , str > = Cow :: Owned ( String :: from ( "Hi, " ) ) ;
11+ let owned2: Cow < ' _ , str > = Cow :: Owned ( String :: from ( "Rustaceans!" ) ) ;
12+ let owned_empty: Cow < ' _ , str > = Cow :: Owned ( String :: new ( ) ) ;
1313
1414 assert_eq ! ( "Hello, World!" , borrowed1. clone( ) + borrowed2. clone( ) ) ;
1515 assert_eq ! ( "Hello, Rustaceans!" , borrowed1. clone( ) + owned2. clone( ) ) ;
@@ -36,8 +36,8 @@ fn check_cow_add_str() {
3636 let borrowed = Cow :: Borrowed ( "Hello, " ) ;
3737 let borrow_empty = Cow :: Borrowed ( "" ) ;
3838
39- let owned: Cow < str > = Cow :: Owned ( String :: from ( "Hi, " ) ) ;
40- let owned_empty: Cow < str > = Cow :: Owned ( String :: new ( ) ) ;
39+ let owned: Cow < ' _ , str > = Cow :: Owned ( String :: from ( "Hi, " ) ) ;
40+ let owned_empty: Cow < ' _ , str > = Cow :: Owned ( String :: new ( ) ) ;
4141
4242 assert_eq ! ( "Hello, World!" , borrowed. clone( ) + "World!" ) ;
4343
@@ -60,9 +60,9 @@ fn check_cow_add_assign_cow() {
6060 let borrowed2 = Cow :: Borrowed ( "World!" ) ;
6161 let borrow_empty = Cow :: Borrowed ( "" ) ;
6262
63- let mut owned1: Cow < str > = Cow :: Owned ( String :: from ( "Hi, " ) ) ;
64- let owned2: Cow < str > = Cow :: Owned ( String :: from ( "Rustaceans!" ) ) ;
65- let owned_empty: Cow < str > = Cow :: Owned ( String :: new ( ) ) ;
63+ let mut owned1: Cow < ' _ , str > = Cow :: Owned ( String :: from ( "Hi, " ) ) ;
64+ let owned2: Cow < ' _ , str > = Cow :: Owned ( String :: from ( "Rustaceans!" ) ) ;
65+ let owned_empty: Cow < ' _ , str > = Cow :: Owned ( String :: new ( ) ) ;
6666
6767 let mut s = borrowed1. clone ( ) ;
6868 s += borrow_empty. clone ( ) ;
@@ -101,8 +101,8 @@ fn check_cow_add_assign_str() {
101101 let mut borrowed = Cow :: Borrowed ( "Hello, " ) ;
102102 let borrow_empty = Cow :: Borrowed ( "" ) ;
103103
104- let mut owned: Cow < str > = Cow :: Owned ( String :: from ( "Hi, " ) ) ;
105- let owned_empty: Cow < str > = Cow :: Owned ( String :: new ( ) ) ;
104+ let mut owned: Cow < ' _ , str > = Cow :: Owned ( String :: from ( "Hi, " ) ) ;
105+ let owned_empty: Cow < ' _ , str > = Cow :: Owned ( String :: new ( ) ) ;
106106
107107 let mut s = borrowed. clone ( ) ;
108108 s += "" ;
@@ -132,10 +132,10 @@ fn check_cow_add_assign_str() {
132132
133133#[ test]
134134fn check_cow_clone_from ( ) {
135- let mut c1: Cow < str > = Cow :: Owned ( String :: with_capacity ( 25 ) ) ;
135+ let mut c1: Cow < ' _ , str > = Cow :: Owned ( String :: with_capacity ( 25 ) ) ;
136136 let s: String = "hi" . to_string ( ) ;
137137 assert ! ( s. capacity( ) < 25 ) ;
138- let c2: Cow < str > = Cow :: Owned ( s) ;
138+ let c2: Cow < ' _ , str > = Cow :: Owned ( s) ;
139139 c1. clone_from ( & c2) ;
140140 assert ! ( c1. into_owned( ) . capacity( ) >= 25 ) ;
141141}
0 commit comments