@@ -296,7 +296,7 @@ pub fn compute_serialized_size_in_words<A>(message: &crate::message::Builder<A>)
296
296
297
297
#[ cfg( test) ]
298
298
pub mod test {
299
- use crate :: io:: { prelude:: * , Cursor } ;
299
+ use crate :: io:: { self , prelude:: * } ;
300
300
301
301
use quickcheck:: { quickcheck, TestResult } ;
302
302
@@ -323,7 +323,7 @@ pub mod test {
323
323
buf. extend ( [ 0 , 0 , 0 , 0 , // 1 segments
324
324
0 , 0 , 0 , 0 ] // 0 length
325
325
. iter ( ) . cloned ( ) ) ;
326
- let ( words, segment_slices) = read_segment_table ( & mut Cursor :: new ( & buf[ ..] ) ,
326
+ let ( words, segment_slices) = read_segment_table ( & mut io :: Cursor :: new ( & buf[ ..] ) ,
327
327
message:: ReaderOptions :: new ( ) ) . unwrap ( ) ;
328
328
assert_eq ! ( 0 , words) ;
329
329
assert_eq ! ( vec![ ( 0 , 0 ) ] , segment_slices) ;
@@ -332,7 +332,7 @@ pub mod test {
332
332
buf. extend ( [ 0 , 0 , 0 , 0 , // 1 segments
333
333
1 , 0 , 0 , 0 ] // 1 length
334
334
. iter ( ) . cloned ( ) ) ;
335
- let ( words, segment_slices) = read_segment_table ( & mut Cursor :: new ( & buf[ ..] ) ,
335
+ let ( words, segment_slices) = read_segment_table ( & mut io :: Cursor :: new ( & buf[ ..] ) ,
336
336
message:: ReaderOptions :: new ( ) ) . unwrap ( ) ;
337
337
assert_eq ! ( 1 , words) ;
338
338
assert_eq ! ( vec![ ( 0 , 1 ) ] , segment_slices) ;
@@ -343,7 +343,7 @@ pub mod test {
343
343
1 , 0 , 0 , 0 , // 1 length
344
344
0 , 0 , 0 , 0 ] // padding
345
345
. iter ( ) . cloned ( ) ) ;
346
- let ( words, segment_slices) = read_segment_table ( & mut Cursor :: new ( & buf[ ..] ) ,
346
+ let ( words, segment_slices) = read_segment_table ( & mut io :: Cursor :: new ( & buf[ ..] ) ,
347
347
message:: ReaderOptions :: new ( ) ) . unwrap ( ) ;
348
348
assert_eq ! ( 2 , words) ;
349
349
assert_eq ! ( vec![ ( 0 , 1 ) , ( 1 , 2 ) ] , segment_slices) ;
@@ -354,7 +354,7 @@ pub mod test {
354
354
1 , 0 , 0 , 0 , // 1 length
355
355
0 , 1 , 0 , 0 ] // 256 length
356
356
. iter ( ) . cloned ( ) ) ;
357
- let ( words, segment_slices) = read_segment_table ( & mut Cursor :: new ( & buf[ ..] ) ,
357
+ let ( words, segment_slices) = read_segment_table ( & mut io :: Cursor :: new ( & buf[ ..] ) ,
358
358
message:: ReaderOptions :: new ( ) ) . unwrap ( ) ;
359
359
assert_eq ! ( 258 , words) ;
360
360
assert_eq ! ( vec![ ( 0 , 1 ) , ( 1 , 2 ) , ( 2 , 258 ) ] , segment_slices) ;
@@ -367,7 +367,7 @@ pub mod test {
367
367
99 , 0 , 0 , 0 , // 99 length
368
368
0 , 0 , 0 , 0 ] // padding
369
369
. iter ( ) . cloned ( ) ) ;
370
- let ( words, segment_slices) = read_segment_table ( & mut Cursor :: new ( & buf[ ..] ) ,
370
+ let ( words, segment_slices) = read_segment_table ( & mut io :: Cursor :: new ( & buf[ ..] ) ,
371
371
message:: ReaderOptions :: new ( ) ) . unwrap ( ) ;
372
372
assert_eq ! ( 200 , words) ;
373
373
assert_eq ! ( vec![ ( 0 , 77 ) , ( 77 , 100 ) , ( 100 , 101 ) , ( 101 , 200 ) ] , segment_slices) ;
@@ -381,23 +381,23 @@ pub mod test {
381
381
382
382
buf. extend ( [ 0 , 2 , 0 , 0 ] . iter ( ) . cloned ( ) ) ; // 513 segments
383
383
buf. extend ( [ 0 ; 513 * 4 ] . iter ( ) . cloned ( ) ) ;
384
- assert ! ( read_segment_table( & mut Cursor :: new( & buf[ ..] ) ,
384
+ assert ! ( read_segment_table( & mut io :: Cursor :: new( & buf[ ..] ) ,
385
385
message:: ReaderOptions :: new( ) ) . is_err( ) ) ;
386
386
buf. clear ( ) ;
387
387
388
388
buf. extend ( [ 0 , 0 , 0 , 0 ] . iter ( ) . cloned ( ) ) ; // 1 segments
389
- assert ! ( read_segment_table( & mut Cursor :: new( & buf[ ..] ) ,
389
+ assert ! ( read_segment_table( & mut io :: Cursor :: new( & buf[ ..] ) ,
390
390
message:: ReaderOptions :: new( ) ) . is_err( ) ) ;
391
391
buf. clear ( ) ;
392
392
393
393
buf. extend ( [ 0 , 0 , 0 , 0 ] . iter ( ) . cloned ( ) ) ; // 1 segments
394
394
buf. extend ( [ 0 ; 3 ] . iter ( ) . cloned ( ) ) ;
395
- assert ! ( read_segment_table( & mut Cursor :: new( & buf[ ..] ) ,
395
+ assert ! ( read_segment_table( & mut io :: Cursor :: new( & buf[ ..] ) ,
396
396
message:: ReaderOptions :: new( ) ) . is_err( ) ) ;
397
397
buf. clear ( ) ;
398
398
399
399
buf. extend ( [ 255 , 255 , 255 , 255 ] . iter ( ) . cloned ( ) ) ; // 0 segments
400
- assert ! ( read_segment_table( & mut Cursor :: new( & buf[ ..] ) ,
400
+ assert ! ( read_segment_table( & mut io :: Cursor :: new( & buf[ ..] ) ,
401
401
message:: ReaderOptions :: new( ) ) . is_err( ) ) ;
402
402
buf. clear ( ) ;
403
403
}
@@ -464,7 +464,7 @@ pub mod test {
464
464
fn check_round_trip ( ) {
465
465
fn round_trip ( segments : Vec < Vec < Word > > ) -> TestResult {
466
466
if segments. len ( ) == 0 { return TestResult :: discard ( ) ; }
467
- let mut cursor = Cursor :: new ( Vec :: new ( ) ) ;
467
+ let mut cursor = io :: Cursor :: new ( Vec :: new ( ) ) ;
468
468
469
469
write_message_segments ( & mut cursor, & segments) ;
470
470
cursor. set_position ( 0 ) ;
0 commit comments