rc => arc

This commit is contained in:
Rob Ede 2020-10-25 01:25:19 +00:00
parent 90fc357542
commit ef3bf12805
No known key found for this signature in database
GPG Key ID: C2A3B36E841A91E6
1 changed files with 3 additions and 7 deletions

View File

@ -359,11 +359,9 @@ where
.client_timeout(c.client_timeout)
.client_disconnect(c.client_shutdown);
let svc = if let Some(handler) =
on_connect_fn.map(|handler| Arc::clone(&handler))
{
let svc = if let Some(handler) = on_connect_fn.clone() {
svc.on_connect_ext(move |io: &_, ext: _| {
(handler)(io as &dyn Any, ext)
(&*handler)(io as &dyn Any, ext)
})
} else {
svc
@ -420,9 +418,7 @@ where
.client_timeout(c.client_timeout)
.client_disconnect(c.client_shutdown);
let svc = if let Some(handler) =
on_connect_fn.map(|handler| Rc::clone(&handler))
{
let svc = if let Some(handler) = on_connect_fn.clone() {
svc.on_connect_ext(move |io: &_, ext: _| {
(handler)(io as &dyn Any, ext)
})