mirror of https://github.com/fafhrd91/actix-web
ScopeConfig: Remove unnecessary changes, handle the case when data is empty
This commit is contained in:
parent
e6bc864e05
commit
972de9497e
|
@ -124,9 +124,7 @@ impl Scope {
|
||||||
self.services.extend(cfg.services);
|
self.services.extend(cfg.services);
|
||||||
|
|
||||||
if !cfg.data.is_empty() {
|
if !cfg.data.is_empty() {
|
||||||
if (&self).data.is_some() {
|
let mut data = self.data.unwrap_or(Extensions::new());
|
||||||
|
|
||||||
let mut data = self.data.unwrap();
|
|
||||||
|
|
||||||
for value in cfg.data.iter() {
|
for value in cfg.data.iter() {
|
||||||
value.create(&mut data);
|
value.create(&mut data);
|
||||||
|
@ -134,7 +132,6 @@ impl Scope {
|
||||||
|
|
||||||
self.data = Some(data);
|
self.data = Some(data);
|
||||||
}
|
}
|
||||||
}
|
|
||||||
self
|
self
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue