mirror of https://github.com/fafhrd91/actix-web
rc => arc
This commit is contained in:
parent
90fc357542
commit
ef3bf12805
|
@ -359,11 +359,9 @@ where
|
||||||
.client_timeout(c.client_timeout)
|
.client_timeout(c.client_timeout)
|
||||||
.client_disconnect(c.client_shutdown);
|
.client_disconnect(c.client_shutdown);
|
||||||
|
|
||||||
let svc = if let Some(handler) =
|
let svc = if let Some(handler) = on_connect_fn.clone() {
|
||||||
on_connect_fn.map(|handler| Arc::clone(&handler))
|
|
||||||
{
|
|
||||||
svc.on_connect_ext(move |io: &_, ext: _| {
|
svc.on_connect_ext(move |io: &_, ext: _| {
|
||||||
(handler)(io as &dyn Any, ext)
|
(&*handler)(io as &dyn Any, ext)
|
||||||
})
|
})
|
||||||
} else {
|
} else {
|
||||||
svc
|
svc
|
||||||
|
@ -420,9 +418,7 @@ where
|
||||||
.client_timeout(c.client_timeout)
|
.client_timeout(c.client_timeout)
|
||||||
.client_disconnect(c.client_shutdown);
|
.client_disconnect(c.client_shutdown);
|
||||||
|
|
||||||
let svc = if let Some(handler) =
|
let svc = if let Some(handler) = on_connect_fn.clone() {
|
||||||
on_connect_fn.map(|handler| Rc::clone(&handler))
|
|
||||||
{
|
|
||||||
svc.on_connect_ext(move |io: &_, ext: _| {
|
svc.on_connect_ext(move |io: &_, ext: _| {
|
||||||
(handler)(io as &dyn Any, ext)
|
(handler)(io as &dyn Any, ext)
|
||||||
})
|
})
|
||||||
|
|
Loading…
Reference in New Issue