refactor!: Refactor CaptchaStorage trait

- Remove the requirement for the `Clone` trait in the `Self`
- Remove the `Display` and `Debug` trait and require `Error` trait
instead in `CaptchaStorage::Error`

Signed-off-by: Awiteb <a@4rs.nl>
This commit is contained in:
Awiteb 2024-08-12 12:23:57 +00:00
parent 25f90ecfaf
commit e21ce0d524
Signed by: awiteb
GPG key ID: 3F6B55640AA6682F

View file

@ -22,12 +22,9 @@ pub use cacache_storage::*;
/// The trait will be implemented for `Arc<T>` if `T` implements the trait.
///
/// The trait is thread safe, so the storage can be shared between threads.
pub trait CaptchaStorage: Send + Sync + 'static
where
Self: Clone + std::fmt::Debug,
{
pub trait CaptchaStorage: Send + Sync + 'static {
/// The error type of the storage.
type Error: std::fmt::Display + std::fmt::Debug + Send;
type Error: std::error::Error + Send;
/// Store the captcha token and answer.
fn store_answer(