@@ -38,7 +38,7 @@ impl HintKind for Exact {
38
38
39
39
impl qc:: Arbitrary for Exact {
40
40
fn arbitrary < G : qc:: Gen > ( _: & mut G ) -> Self {
41
- Exact { }
41
+ Self { }
42
42
}
43
43
}
44
44
@@ -69,7 +69,7 @@ impl qc::Arbitrary for Inexact {
69
69
// Compensate for quickcheck using extreme values too rarely
70
70
let ue_choices = & [ 0 , ue_value, usize:: max_value ( ) ] ;
71
71
let oe_choices = & [ 0 , oe_value, usize:: max_value ( ) ] ;
72
- Inexact {
72
+ Self {
73
73
underestimate : * ue_choices. choose ( g) . unwrap ( ) ,
74
74
overestimate : * oe_choices. choose ( g) . unwrap ( ) ,
75
75
}
@@ -79,7 +79,7 @@ impl qc::Arbitrary for Inexact {
79
79
let underestimate_value = self . underestimate ;
80
80
let overestimate_value = self . overestimate ;
81
81
Box :: new ( underestimate_value. shrink ( ) . flat_map ( move |ue_value| {
82
- overestimate_value. shrink ( ) . map ( move |oe_value| Inexact {
82
+ overestimate_value. shrink ( ) . map ( move |oe_value| Self {
83
83
underestimate : ue_value,
84
84
overestimate : oe_value,
85
85
} )
@@ -108,7 +108,7 @@ where
108
108
HK : HintKind ,
109
109
{
110
110
fn new ( it : Range < T > , hint_kind : HK ) -> Self {
111
- Iter {
111
+ Self {
112
112
iterator : it,
113
113
fuse_flag : 0 ,
114
114
hint_kind,
@@ -166,16 +166,16 @@ where
166
166
HK : HintKind ,
167
167
{
168
168
fn arbitrary < G : qc:: Gen > ( g : & mut G ) -> Self {
169
- Iter :: new ( T :: arbitrary ( g) ..T :: arbitrary ( g) , HK :: arbitrary ( g) )
169
+ Self :: new ( T :: arbitrary ( g) ..T :: arbitrary ( g) , HK :: arbitrary ( g) )
170
170
}
171
171
172
- fn shrink ( & self ) -> Box < dyn Iterator < Item = Iter < T , HK > > > {
172
+ fn shrink ( & self ) -> Box < dyn Iterator < Item = Self > > {
173
173
let r = self . iterator . clone ( ) ;
174
174
let hint_kind = self . hint_kind ;
175
175
Box :: new ( r. start . shrink ( ) . flat_map ( move |a| {
176
176
r. end
177
177
. shrink ( )
178
- . map ( move |b| Iter :: new ( a. clone ( ) ..b, hint_kind) )
178
+ . map ( move |b| Self :: new ( a. clone ( ) ..b, hint_kind) )
179
179
} ) )
180
180
}
181
181
}
@@ -231,7 +231,7 @@ where
231
231
let iter_count = g. gen_range ( 0 , MAX_ITER_COUNT + 1 ) ;
232
232
let hint_kind = qc:: Arbitrary :: arbitrary ( g) ;
233
233
234
- ShiftRange {
234
+ Self {
235
235
range_start,
236
236
range_end,
237
237
start_step,
@@ -1307,25 +1307,25 @@ quickcheck! {
1307
1307
#[ derive( Clone , Debug , PartialEq , Eq ) ]
1308
1308
struct Val ( u32 , u32 ) ;
1309
1309
1310
- impl PartialOrd < Val > for Val {
1311
- fn partial_cmp ( & self , other : & Val ) -> Option < Ordering > {
1310
+ impl PartialOrd < Self > for Val {
1311
+ fn partial_cmp ( & self , other : & Self ) -> Option < Ordering > {
1312
1312
Some ( self . cmp ( other) )
1313
1313
}
1314
1314
}
1315
1315
1316
1316
impl Ord for Val {
1317
- fn cmp ( & self , other : & Val ) -> Ordering {
1317
+ fn cmp ( & self , other : & Self ) -> Ordering {
1318
1318
self . 0 . cmp ( & other. 0 )
1319
1319
}
1320
1320
}
1321
1321
1322
1322
impl qc:: Arbitrary for Val {
1323
1323
fn arbitrary < G : qc:: Gen > ( g : & mut G ) -> Self {
1324
1324
let ( x, y) = <( u32 , u32 ) >:: arbitrary ( g) ;
1325
- Val ( x, y)
1325
+ Self ( x, y)
1326
1326
}
1327
1327
fn shrink ( & self ) -> Box < dyn Iterator < Item = Self > > {
1328
- Box :: new ( ( self . 0 , self . 1 ) . shrink ( ) . map ( |( x, y) | Val ( x, y) ) )
1328
+ Box :: new ( ( self . 0 , self . 1 ) . shrink ( ) . map ( |( x, y) | Self ( x, y) ) )
1329
1329
}
1330
1330
}
1331
1331
0 commit comments