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
13
src/scope.rs
13
src/scope.rs
|
@ -124,16 +124,13 @@ impl Scope {
|
|||
self.services.extend(cfg.services);
|
||||
|
||||
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() {
|
||||
value.create(&mut data);
|
||||
}
|
||||
|
||||
self.data = Some(data);
|
||||
for value in cfg.data.iter() {
|
||||
value.create(&mut data);
|
||||
}
|
||||
|
||||
self.data = Some(data);
|
||||
}
|
||||
self
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue