1
0
mirror of https://github.com/fafhrd91/actix-web synced 2025-08-19 12:25:37 +02:00

Allow to set/override app data on scope level

This commit is contained in:
Nikolay Kim
2019-05-12 09:42:05 -07:00
parent df08baf67f
commit 45c05978b0
6 changed files with 90 additions and 20 deletions

View File

@@ -95,8 +95,8 @@ where
/// web::get().to(index)));
/// }
/// ```
pub fn data<U: Into<Data<U>> + 'static>(mut self, data: U) -> Self {
self.data.push(Box::new(data.into()));
pub fn data<U: 'static>(mut self, data: U) -> Self {
self.data.push(Box::new(Data::new(data)));
self
}