fix clippy

This commit is contained in:
Rob Ede 2022-04-08 13:40:55 +01:00
parent 34ef7d1bd1
commit f8860bb4e9
No known key found for this signature in database
GPG Key ID: 97C636207D3EF933
4 changed files with 47 additions and 45 deletions

View File

@ -119,6 +119,7 @@ mod _original {
let mut headers: [HeaderIndex; MAX_HEADERS] = let mut headers: [HeaderIndex; MAX_HEADERS] =
unsafe { MaybeUninit::uninit().assume_init() }; unsafe { MaybeUninit::uninit().assume_init() };
#[allow(invalid_value)]
let mut parsed: [httparse::Header<'_>; MAX_HEADERS] = let mut parsed: [httparse::Header<'_>; MAX_HEADERS] =
unsafe { MaybeUninit::uninit().assume_init() }; unsafe { MaybeUninit::uninit().assume_init() };

View File

@ -263,10 +263,7 @@ mod tests {
assert_not_impl_any!(Payload: Send, Sync, UnwindSafe, RefUnwindSafe); assert_not_impl_any!(Payload: Send, Sync, UnwindSafe, RefUnwindSafe);
assert_impl_all!(Inner: Unpin, Send, Sync); assert_impl_all!(Inner: Unpin, Send, Sync);
#[rustversion::before(1.60)] // assert_not_impl_any!(Inner: UnwindSafe, RefUnwindSafe);
assert_not_impl_any!(Inner: UnwindSafe, RefUnwindSafe);
#[rustversion::since(1.60)]
assert_impl_all!(Inner: UnwindSafe, RefUnwindSafe);
#[actix_rt::test] #[actix_rt::test]
async fn test_unread_data() { async fn test_unread_data() {

View File

@ -357,7 +357,9 @@ mod tests {
#[actix_rt::test] #[actix_rt::test]
async fn route_middleware() { async fn route_middleware() {
let srv = init_service( let srv = init_service(
App::new().service( App::new()
.route("/", web::get().to(HttpResponse::Ok).wrap(Logger::default()))
.service(
web::resource("/test") web::resource("/test")
.route(web::get().to(HttpResponse::Ok)) .route(web::get().to(HttpResponse::Ok))
.route( .route(

View File

@ -799,6 +799,7 @@ async fn test_server_cookies() {
let res = req.send().await.unwrap(); let res = req.send().await.unwrap();
assert!(res.status().is_success()); assert!(res.status().is_success());
{
let first_cookie = Cookie::build("first", "first_value") let first_cookie = Cookie::build("first", "first_value")
.http_only(true) .http_only(true)
.finish(); .finish();
@ -828,6 +829,7 @@ async fn test_server_cookies() {
assert_eq!(cookies[0], second_cookie); assert_eq!(cookies[0], second_cookie);
assert_eq!(cookies[1], first_cookie); assert_eq!(cookies[1], first_cookie);
} }
}
srv.stop().await; srv.stop().await;
} }