@@ -24,7 +24,7 @@ use super::{Ivar, IvarType};
24
24
25
25
impl < T : IvarType > PartialEq for Ivar < T >
26
26
where
27
- T :: Type : PartialEq ,
27
+ < Self as Deref > :: Target : PartialEq ,
28
28
{
29
29
#[ inline]
30
30
fn eq ( & self , other : & Self ) -> bool {
@@ -38,11 +38,11 @@ where
38
38
}
39
39
}
40
40
41
- impl < T : IvarType > Eq for Ivar < T > where T :: Type : Eq { }
41
+ impl < T : IvarType > Eq for Ivar < T > where < Self as Deref > :: Target : Eq { }
42
42
43
43
impl < T : IvarType > PartialOrd for Ivar < T >
44
44
where
45
- T :: Type : PartialOrd ,
45
+ < Self as Deref > :: Target : PartialOrd ,
46
46
{
47
47
#[ inline]
48
48
fn partial_cmp ( & self , other : & Self ) -> Option < Ordering > {
68
68
69
69
impl < T : IvarType > Ord for Ivar < T >
70
70
where
71
- T :: Type : Ord ,
71
+ < Self as Deref > :: Target : Ord ,
72
72
{
73
73
#[ inline]
74
74
fn cmp ( & self , other : & Self ) -> Ordering {
78
78
79
79
impl < T : IvarType > hash:: Hash for Ivar < T >
80
80
where
81
- T :: Type : hash:: Hash ,
81
+ < Self as Deref > :: Target : hash:: Hash ,
82
82
{
83
83
fn hash < H : hash:: Hasher > ( & self , state : & mut H ) {
84
84
( * * self ) . hash ( state)
87
87
88
88
impl < T : IvarType > hash:: Hasher for Ivar < T >
89
89
where
90
- T :: Type : hash:: Hasher ,
90
+ < Self as Deref > :: Target : hash:: Hasher ,
91
91
{
92
92
fn finish ( & self ) -> u64 {
93
93
( * * self ) . finish ( )
@@ -135,7 +135,7 @@ where
135
135
136
136
impl < T : IvarType > fmt:: Display for Ivar < T >
137
137
where
138
- T :: Type : fmt:: Display ,
138
+ < Self as Deref > :: Target : fmt:: Display ,
139
139
{
140
140
fn fmt ( & self , f : & mut fmt:: Formatter < ' _ > ) -> fmt:: Result {
141
141
( * * self ) . fmt ( f)
@@ -144,7 +144,7 @@ where
144
144
145
145
impl < T : IvarType > fmt:: Debug for Ivar < T >
146
146
where
147
- T :: Type : fmt:: Debug ,
147
+ < Self as Deref > :: Target : fmt:: Debug ,
148
148
{
149
149
fn fmt ( & self , f : & mut fmt:: Formatter < ' _ > ) -> fmt:: Result {
150
150
( * * self ) . fmt ( f)
@@ -153,70 +153,70 @@ where
153
153
154
154
impl < I : IvarType > Iterator for Ivar < I >
155
155
where
156
- I :: Type : Iterator ,
156
+ < Self as Deref > :: Target : Iterator ,
157
157
{
158
- type Item = <I :: Type as Iterator >:: Item ;
159
- fn next ( & mut self ) -> Option < <I :: Type as Iterator >:: Item > {
158
+ type Item = << Self as Deref > :: Target as Iterator >:: Item ;
159
+ fn next ( & mut self ) -> Option < << Self as Deref > :: Target as Iterator >:: Item > {
160
160
( * * self ) . next ( )
161
161
}
162
162
fn size_hint ( & self ) -> ( usize , Option < usize > ) {
163
163
( * * self ) . size_hint ( )
164
164
}
165
- fn nth ( & mut self , n : usize ) -> Option < <I :: Type as Iterator >:: Item > {
165
+ fn nth ( & mut self , n : usize ) -> Option < << Self as Deref > :: Target as Iterator >:: Item > {
166
166
( * * self ) . nth ( n)
167
167
}
168
168
}
169
169
170
170
impl < I : IvarType > DoubleEndedIterator for Ivar < I >
171
171
where
172
- I :: Type : DoubleEndedIterator ,
172
+ < Self as Deref > :: Target : DoubleEndedIterator ,
173
173
{
174
- fn next_back ( & mut self ) -> Option < <I :: Type as Iterator >:: Item > {
174
+ fn next_back ( & mut self ) -> Option < << Self as Deref > :: Target as Iterator >:: Item > {
175
175
( * * self ) . next_back ( )
176
176
}
177
- fn nth_back ( & mut self , n : usize ) -> Option < <I :: Type as Iterator >:: Item > {
177
+ fn nth_back ( & mut self , n : usize ) -> Option < << Self as Deref > :: Target as Iterator >:: Item > {
178
178
( * * self ) . nth_back ( n)
179
179
}
180
180
}
181
181
182
182
impl < I : IvarType > ExactSizeIterator for Ivar < I >
183
183
where
184
- I :: Type : ExactSizeIterator ,
184
+ < Self as Deref > :: Target : ExactSizeIterator ,
185
185
{
186
186
fn len ( & self ) -> usize {
187
187
( * * self ) . len ( )
188
188
}
189
189
}
190
190
191
- impl < I : IvarType > FusedIterator for Ivar < I > where I :: Type : FusedIterator { }
191
+ impl < I : IvarType > FusedIterator for Ivar < I > where < Self as Deref > :: Target : FusedIterator { }
192
192
193
- // impl<T: IvarType> borrow::Borrow<T::Type > for Ivar<T> {
194
- // fn borrow(&self) -> &T::Type {
193
+ // impl<T: IvarType> borrow::Borrow<<Self as Deref>::Target > for Ivar<T> {
194
+ // fn borrow(&self) -> &<Self as Deref>::Target {
195
195
// Deref::deref(self)
196
196
// }
197
197
// }
198
198
//
199
- // impl<T: IvarType> borrow::BorrowMut<T::Type > for Ivar<T> {
200
- // fn borrow_mut(&mut self) -> &mut T::Type {
199
+ // impl<T: IvarType> borrow::BorrowMut<<Self as Deref>::Target > for Ivar<T> {
200
+ // fn borrow_mut(&mut self) -> &mut <Self as Deref>::Target {
201
201
// DerefMut::deref_mut(self)
202
202
// }
203
203
// }
204
204
205
- impl < T : IvarType > AsRef < T :: Type > for Ivar < T > {
206
- fn as_ref ( & self ) -> & T :: Type {
205
+ impl < T : IvarType > AsRef < < Self as Deref > :: Target > for Ivar < T > {
206
+ fn as_ref ( & self ) -> & < Self as Deref > :: Target {
207
207
Deref :: deref ( self )
208
208
}
209
209
}
210
210
211
- impl < T : IvarType > AsMut < T :: Type > for Ivar < T > {
212
- fn as_mut ( & mut self ) -> & mut T :: Type {
211
+ impl < T : IvarType > AsMut < < Self as Deref > :: Target > for Ivar < T > {
212
+ fn as_mut ( & mut self ) -> & mut < Self as Deref > :: Target {
213
213
DerefMut :: deref_mut ( self )
214
214
}
215
215
}
216
216
217
217
impl < T : IvarType > Error for Ivar < T >
218
218
where
219
- T :: Type : Error ,
219
+ < Self as Deref > :: Target : Error ,
220
220
{
221
221
fn source ( & self ) -> Option < & ( dyn Error + ' static ) > {
222
222
( * * self ) . source ( )
@@ -225,7 +225,7 @@ where
225
225
226
226
impl < T : IvarType > io:: Read for Ivar < T >
227
227
where
228
- T :: Type : io:: Read ,
228
+ < Self as Deref > :: Target : io:: Read ,
229
229
{
230
230
#[ inline]
231
231
fn read ( & mut self , buf : & mut [ u8 ] ) -> io:: Result < usize > {
@@ -255,7 +255,7 @@ where
255
255
256
256
impl < T : IvarType > io:: Write for Ivar < T >
257
257
where
258
- T :: Type : io:: Write ,
258
+ < Self as Deref > :: Target : io:: Write ,
259
259
{
260
260
#[ inline]
261
261
fn write ( & mut self , buf : & [ u8 ] ) -> io:: Result < usize > {
@@ -285,7 +285,7 @@ where
285
285
286
286
impl < T : IvarType > io:: Seek for Ivar < T >
287
287
where
288
- T :: Type : io:: Seek ,
288
+ < Self as Deref > :: Target : io:: Seek ,
289
289
{
290
290
#[ inline]
291
291
fn seek ( & mut self , pos : io:: SeekFrom ) -> io:: Result < u64 > {
@@ -300,7 +300,7 @@ where
300
300
301
301
impl < T : IvarType > io:: BufRead for Ivar < T >
302
302
where
303
- T :: Type : io:: BufRead ,
303
+ < Self as Deref > :: Target : io:: BufRead ,
304
304
{
305
305
#[ inline]
306
306
fn fill_buf ( & mut self ) -> io:: Result < & [ u8 ] > {
@@ -325,12 +325,12 @@ where
325
325
326
326
impl < T : IvarType > Future for Ivar < T >
327
327
where
328
- T :: Type : Future + Unpin ,
328
+ < Self as Deref > :: Target : Future + Unpin ,
329
329
{
330
- type Output = <T :: Type as Future >:: Output ;
330
+ type Output = << Self as Deref > :: Target as Future >:: Output ;
331
331
332
332
fn poll ( mut self : Pin < & mut Self > , cx : & mut Context < ' _ > ) -> Poll < Self :: Output > {
333
- <T :: Type as Future >:: poll ( Pin :: new ( & mut * self ) , cx)
333
+ << Self as Deref > :: Target as Future >:: poll ( Pin :: new ( & mut * self ) , cx)
334
334
}
335
335
}
336
336
0 commit comments