@@ -90,7 +90,7 @@ mod tests {
90
90
fn test_static ( ) {
91
91
let td = TempDir :: new ( "conduit-static" ) . unwrap ( ) ;
92
92
let root = td. path ( ) ;
93
- let handler = Static :: new ( root. clone ( ) ) ;
93
+ let handler = Static :: new ( root) ;
94
94
File :: create ( & root. join ( "Cargo.toml" ) )
95
95
. unwrap ( )
96
96
. write_all ( b"[package]" )
@@ -102,7 +102,7 @@ mod tests {
102
102
"text/plain"
103
103
) ;
104
104
assert_eq ! ( res. headers( ) . get( header:: CONTENT_LENGTH ) . unwrap( ) , "9" ) ;
105
- assert_eq ! ( res. into_cow( ) , "[package]" . as_bytes ( ) ) ;
105
+ assert_eq ! ( * res. into_cow( ) , b "[package]"[ .. ] ) ;
106
106
}
107
107
108
108
#[ test]
@@ -112,7 +112,7 @@ mod tests {
112
112
fs:: create_dir ( & root. join ( "src" ) ) . unwrap ( ) ;
113
113
File :: create ( & root. join ( "src/fixture.css" ) ) . unwrap ( ) ;
114
114
115
- let handler = Static :: new ( root. clone ( ) ) ;
115
+ let handler = Static :: new ( root) ;
116
116
let mut req = MockRequest :: new ( Method :: GET , "/src/fixture.css" ) ;
117
117
let res = handler. call ( & mut req) . expect ( "No response" ) ;
118
118
assert_eq ! ( res. headers( ) . get( header:: CONTENT_TYPE ) . unwrap( ) , "text/css" ) ;
@@ -124,7 +124,7 @@ mod tests {
124
124
let td = TempDir :: new ( "conduit-static" ) . unwrap ( ) ;
125
125
let root = td. path ( ) ;
126
126
127
- let handler = Static :: new ( root. clone ( ) ) ;
127
+ let handler = Static :: new ( root) ;
128
128
let mut req = MockRequest :: new ( Method :: GET , "/nope" ) ;
129
129
let res = handler. call ( & mut req) . expect ( "No response" ) ;
130
130
assert_eq ! ( res. status( ) , StatusCode :: NOT_FOUND ) ;
@@ -137,7 +137,7 @@ mod tests {
137
137
138
138
fs:: create_dir ( & root. join ( "foo" ) ) . unwrap ( ) ;
139
139
140
- let handler = Static :: new ( root. clone ( ) ) ;
140
+ let handler = Static :: new ( root) ;
141
141
let mut req = MockRequest :: new ( Method :: GET , "/foo" ) ;
142
142
let res = handler. call ( & mut req) . expect ( "No response" ) ;
143
143
assert_eq ! ( res. status( ) , StatusCode :: NOT_FOUND ) ;
@@ -148,7 +148,7 @@ mod tests {
148
148
let td = TempDir :: new ( "conduit-static" ) . unwrap ( ) ;
149
149
let root = td. path ( ) ;
150
150
File :: create ( & root. join ( "test" ) ) . unwrap ( ) ;
151
- let handler = Static :: new ( root. clone ( ) ) ;
151
+ let handler = Static :: new ( root) ;
152
152
let mut req = MockRequest :: new ( Method :: GET , "/test" ) ;
153
153
let res = handler. call ( & mut req) . expect ( "No response" ) ;
154
154
assert_eq ! ( res. status( ) , StatusCode :: OK ) ;
0 commit comments