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

Expose factory traits and some clippy fixes (#983)

This commit is contained in:
Ravi Shankar
2019-07-17 12:28:42 +05:30
committed by Nikolay Kim
parent c01611d8b5
commit 32718b7e31
13 changed files with 16 additions and 9 deletions

View File

@ -118,7 +118,7 @@ impl<T: 'static> FromRequest for Data<T> {
impl<T: 'static> DataFactory for Data<T> {
fn create(&self, extensions: &mut Extensions) -> bool {
if !extensions.contains::<Data<T>>() {
let _ = extensions.insert(Data(self.0.clone()));
extensions.insert(Data(self.0.clone()));
true
} else {
false