1
0
mirror of https://github.com/fafhrd91/actix-web synced 2025-09-01 01:16:59 +02:00

Allow to construct Data instances to avoid double Arc for Send + Sync types.

This commit is contained in:
Nikolay Kim
2019-04-29 09:26:12 -07:00
parent b51b5b763c
commit 29a841529f
4 changed files with 35 additions and 17 deletions

View File

@@ -555,7 +555,7 @@ mod tests {
web::resource("/index.html")
.route(web::put().to(|| HttpResponse::Ok().body("put!")))
.route(web::patch().to(|| HttpResponse::Ok().body("patch!")))
.route(web::delete().to(|| HttpResponse::Ok().body("delete!")))
.route(web::delete().to(|| HttpResponse::Ok().body("delete!"))),
),
);
@@ -575,9 +575,7 @@ mod tests {
let result = read_response(&mut app, patch_req);
assert_eq!(result, Bytes::from_static(b"patch!"));
let delete_req = TestRequest::delete()
.uri("/index.html")
.to_request();
let delete_req = TestRequest::delete().uri("/index.html").to_request();
let result = read_response(&mut app, delete_req);
assert_eq!(result, Bytes::from_static(b"delete!"));
}