@@ -7,9 +7,9 @@ fn check_cow_add_cow() {
7
7
let borrowed2 = Cow :: Borrowed ( "World!" ) ;
8
8
let borrow_empty = Cow :: Borrowed ( "" ) ;
9
9
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 ( ) ) ;
13
13
14
14
assert_eq ! ( "Hello, World!" , borrowed1. clone( ) + borrowed2. clone( ) ) ;
15
15
assert_eq ! ( "Hello, Rustaceans!" , borrowed1. clone( ) + owned2. clone( ) ) ;
@@ -36,8 +36,8 @@ fn check_cow_add_str() {
36
36
let borrowed = Cow :: Borrowed ( "Hello, " ) ;
37
37
let borrow_empty = Cow :: Borrowed ( "" ) ;
38
38
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 ( ) ) ;
41
41
42
42
assert_eq ! ( "Hello, World!" , borrowed. clone( ) + "World!" ) ;
43
43
@@ -60,9 +60,9 @@ fn check_cow_add_assign_cow() {
60
60
let borrowed2 = Cow :: Borrowed ( "World!" ) ;
61
61
let borrow_empty = Cow :: Borrowed ( "" ) ;
62
62
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 ( ) ) ;
66
66
67
67
let mut s = borrowed1. clone ( ) ;
68
68
s += borrow_empty. clone ( ) ;
@@ -101,8 +101,8 @@ fn check_cow_add_assign_str() {
101
101
let mut borrowed = Cow :: Borrowed ( "Hello, " ) ;
102
102
let borrow_empty = Cow :: Borrowed ( "" ) ;
103
103
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 ( ) ) ;
106
106
107
107
let mut s = borrowed. clone ( ) ;
108
108
s += "" ;
@@ -132,10 +132,10 @@ fn check_cow_add_assign_str() {
132
132
133
133
#[ test]
134
134
fn 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 ) ) ;
136
136
let s: String = "hi" . to_string ( ) ;
137
137
assert ! ( s. capacity( ) < 25 ) ;
138
- let c2: Cow < str > = Cow :: Owned ( s) ;
138
+ let c2: Cow < ' _ , str > = Cow :: Owned ( s) ;
139
139
c1. clone_from ( & c2) ;
140
140
assert ! ( c1. into_owned( ) . capacity( ) >= 25 ) ;
141
141
}
0 commit comments