@@ -72,7 +72,7 @@ mod tests {
72
72
#[ derive( Debug ) ]
73
73
struct VariableStream {
74
74
bytes_to_repeat : Bytes ,
75
- max_iterations : usize ,
75
+ max_iterations : u64 ,
76
76
iterations_detected : Arc < Mutex < usize > > ,
77
77
}
78
78
@@ -103,14 +103,15 @@ mod tests {
103
103
104
104
async fn get ( & self , location : & Path ) -> object_store:: Result < GetResult > {
105
105
let bytes = self . bytes_to_repeat . clone ( ) ;
106
- let range = 0 ..bytes. len ( ) * self . max_iterations ;
106
+ let len = bytes. len ( ) as u64 ;
107
+ let range = 0 ..len * self . max_iterations ;
107
108
let arc = self . iterations_detected . clone ( ) ;
108
109
let stream = futures:: stream:: repeat_with ( move || {
109
110
let arc_inner = arc. clone ( ) ;
110
111
* arc_inner. lock ( ) . unwrap ( ) += 1 ;
111
112
Ok ( bytes. clone ( ) )
112
113
} )
113
- . take ( self . max_iterations )
114
+ . take ( self . max_iterations as usize )
114
115
. boxed ( ) ;
115
116
116
117
Ok ( GetResult {
@@ -138,7 +139,7 @@ mod tests {
138
139
async fn get_ranges (
139
140
& self ,
140
141
_location : & Path ,
141
- _ranges : & [ Range < usize > ] ,
142
+ _ranges : & [ Range < u64 > ] ,
142
143
) -> object_store:: Result < Vec < Bytes > > {
143
144
unimplemented ! ( )
144
145
}
@@ -154,7 +155,7 @@ mod tests {
154
155
fn list (
155
156
& self ,
156
157
_prefix : Option < & Path > ,
157
- ) -> BoxStream < ' _ , object_store:: Result < ObjectMeta > > {
158
+ ) -> BoxStream < ' static , object_store:: Result < ObjectMeta > > {
158
159
unimplemented ! ( )
159
160
}
160
161
@@ -179,7 +180,7 @@ mod tests {
179
180
}
180
181
181
182
impl VariableStream {
182
- pub fn new ( bytes_to_repeat : Bytes , max_iterations : usize ) -> Self {
183
+ pub fn new ( bytes_to_repeat : Bytes , max_iterations : u64 ) -> Self {
183
184
Self {
184
185
bytes_to_repeat,
185
186
max_iterations,
@@ -371,7 +372,7 @@ mod tests {
371
372
let object_meta = ObjectMeta {
372
373
location : Path :: parse ( "/" ) ?,
373
374
last_modified : DateTime :: default ( ) ,
374
- size : usize :: MAX ,
375
+ size : u64 :: MAX ,
375
376
e_tag : None ,
376
377
version : None ,
377
378
} ;
@@ -429,7 +430,7 @@ mod tests {
429
430
let object_meta = ObjectMeta {
430
431
location : Path :: parse ( "/" ) ?,
431
432
last_modified : DateTime :: default ( ) ,
432
- size : usize :: MAX ,
433
+ size : u64 :: MAX ,
433
434
e_tag : None ,
434
435
version : None ,
435
436
} ;
0 commit comments