diff --git a/src/storage.rs b/src/storage.rs index c7adf87..427c92c 100644 --- a/src/storage.rs +++ b/src/storage.rs @@ -20,7 +20,7 @@ use crate::types::Token; /// For completeness, the underlying, sorted scopes are provided as well. They might be /// useful for presentation to the user. pub trait TokenStorage { - type Error: 'static + Error; + type Error: 'static + Error + Send; /// If `token` is None, it is invalid or revoked and should be removed from storage. /// Otherwise, it should be saved. @@ -85,6 +85,12 @@ pub struct MemoryStorage { pub tokens: HashMap, } +impl MemoryStorage { + pub fn new() -> MemoryStorage { + Default::default() + } +} + impl TokenStorage for MemoryStorage { type Error = NullError;