1
0
mirror of https://github.com/fafhrd91/actix-web synced 2025-07-01 00:44:26 +02:00

Make web::Data deref to Arc<T> #1214

This commit is contained in:
Nikolay Kim
2019-12-20 17:45:35 +06:00
parent 8b8a9a995d
commit e5a50f423d
4 changed files with 18 additions and 14 deletions

View File

@ -1106,7 +1106,7 @@ mod tests {
web::scope("app").data(10usize).route(
"/t",
web::get().to(|data: web::Data<usize>| {
assert_eq!(*data, 10);
assert_eq!(**data, 10);
let _ = data.clone();
HttpResponse::Ok()
}),
@ -1125,7 +1125,7 @@ mod tests {
web::scope("app").app_data(web::Data::new(10usize)).route(
"/t",
web::get().to(|data: web::Data<usize>| {
assert_eq!(*data, 10);
assert_eq!(**data, 10);
let _ = data.clone();
HttpResponse::Ok()
}),