@@ -34,7 +34,6 @@ use crate::{
34
34
BrowserSessionRepository , UserEmailRepository , UserPasswordRepository ,
35
35
UserRecoveryRepository , UserRepository , UserTermsRepository ,
36
36
} ,
37
- MapErr ,
38
37
} ;
39
38
40
39
/// A [`Repository`] helps interacting with the underlying storage backend.
@@ -43,21 +42,6 @@ pub trait Repository<E>:
43
42
where
44
43
E : std:: error:: Error + Send + Sync + ' static ,
45
44
{
46
- /// Construct a (boxed) typed-erased repository
47
- fn boxed ( self ) -> BoxRepository < E >
48
- where
49
- Self : Sync + Sized + ' static ,
50
- {
51
- Box :: new ( self )
52
- }
53
-
54
- /// Map the error type of all the methods of a [`Repository`]
55
- fn map_err < Mapper > ( self , mapper : Mapper ) -> MapErr < Self , Mapper >
56
- where
57
- Self : Sized ,
58
- {
59
- MapErr :: new ( self , mapper)
60
- }
61
45
}
62
46
63
47
/// An opaque, type-erased error
@@ -80,7 +64,7 @@ impl RepositoryError {
80
64
}
81
65
82
66
/// A type-erased [`Repository`]
83
- pub type BoxRepository < E = RepositoryError > = Box < dyn Repository < E > + Send + Sync + ' static > ;
67
+ pub type BoxRepository = Box < dyn Repository < RepositoryError > + Send + Sync + ' static > ;
84
68
85
69
/// A [`RepositoryTransaction`] can be saved or cancelled, after a series
86
70
/// of operations.
@@ -113,7 +97,7 @@ pub trait RepositoryTransaction {
113
97
/// repository is used at a time.
114
98
///
115
99
/// When adding a new repository, you should add a new method to this trait, and
116
- /// update the implementations for [`MapErr`] and [`Box<R>`] below.
100
+ /// update the implementations for [`crate:: MapErr`] and [`Box<R>`] below.
117
101
///
118
102
/// Note: this used to have generic associated types to avoid boxing all the
119
103
/// repository traits, but that was removed because it made almost impossible to
@@ -218,7 +202,7 @@ pub trait RepositoryAccess: Send {
218
202
}
219
203
220
204
/// Implementations of the [`RepositoryAccess`], [`RepositoryTransaction`] and
221
- /// [`Repository`] for the [`MapErr`] wrapper and [`Box<R>`]
205
+ /// [`Repository`] for the [`crate:: MapErr`] wrapper and [`Box<R>`]
222
206
mod impls {
223
207
use futures_util:: { future:: BoxFuture , FutureExt , TryFutureExt } ;
224
208
0 commit comments