Skip to content

Commit 1d4e6c7

Browse files
committed
Fix clippy lints
1 parent ebb4b9f commit 1d4e6c7

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/lib.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ fn is_modified_since(modified_since: Tm, res: &Response<Body>) -> bool {
7878
}
7979
}
8080

81-
fn get_and_concat_header<'a>(headers: &'a HeaderMap, name: header::HeaderName) -> Cow<'a, [u8]> {
81+
fn get_and_concat_header(headers: &HeaderMap, name: header::HeaderName) -> Cow<'_, [u8]> {
8282
let mut values = headers.get_all(name).iter();
8383
if values.size_hint() == (1, Some(1)) {
8484
// Exactly 1 value, allocation is unnecessary
@@ -241,7 +241,7 @@ mod tests {
241241
fn expect_304(response: HandlerResult) {
242242
let response = response.expect("No response");
243243
assert_eq!(response.status(), StatusCode::NOT_MODIFIED);
244-
assert_eq!(response.into_cow(), "".as_bytes());
244+
assert_eq!(*response.into_cow(), b""[..]);
245245
}
246246

247247
fn expect_200(response: HandlerResult) {
@@ -251,7 +251,7 @@ mod tests {
251251
fn expect(status: StatusCode, response: HandlerResult) {
252252
let response = response.expect("No response");
253253
assert_eq!(response.status(), status);
254-
assert_eq!(response.into_cow(), "hello".as_bytes());
254+
assert_eq!(*response.into_cow(), b"hello"[..]);
255255
}
256256

257257
struct SimpleHandler {

0 commit comments

Comments
 (0)