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:
@@ -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
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user