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

Fix clippy::rc_buffer (#1728)

This commit is contained in:
Jonas Platte
2020-10-10 02:26:05 +02:00
committed by GitHub
parent 34b23f31c9
commit d765e9099d
6 changed files with 31 additions and 29 deletions

View File

@ -442,16 +442,17 @@ where
*self.factory_ref.borrow_mut() = Some(ScopeFactory {
data: self.data.take().map(Rc::new),
default: self.default.clone(),
services: Rc::new(
cfg.into_services()
.1
.into_iter()
.map(|(mut rdef, srv, guards, nested)| {
rmap.add(&mut rdef, nested);
(rdef, srv, RefCell::new(guards))
})
.collect(),
),
services: cfg
.into_services()
.1
.into_iter()
.map(|(mut rdef, srv, guards, nested)| {
rmap.add(&mut rdef, nested);
(rdef, srv, RefCell::new(guards))
})
.collect::<Vec<_>>()
.into_boxed_slice()
.into(),
});
// get guards
@ -473,7 +474,7 @@ where
pub struct ScopeFactory {
data: Option<Rc<Extensions>>,
services: Rc<Vec<(ResourceDef, HttpNewService, RefCell<Option<Guards>>)>>,
services: Rc<[(ResourceDef, HttpNewService, RefCell<Option<Guards>>)]>,
default: Rc<RefCell<Option<Rc<HttpNewService>>>>,
}