@@ -353,7 +353,7 @@ fn test_read_to_end_capacity() -> io::Result<()> {
353
353
}
354
354
355
355
#[ test]
356
- fn io_slice_mut_advance_slice ( ) {
356
+ fn io_slice_mut_advance_slices ( ) {
357
357
let mut buf1 = [ 1 ; 8 ] ;
358
358
let mut buf2 = [ 2 ; 16 ] ;
359
359
let mut buf3 = [ 3 ; 8 ] ;
@@ -364,75 +364,75 @@ fn io_slice_mut_advance_slice() {
364
364
] [ ..] ;
365
365
366
366
// Only in a single buffer..
367
- IoSliceMut :: advance_slice ( & mut bufs, 1 ) ;
367
+ IoSliceMut :: advance_slices ( & mut bufs, 1 ) ;
368
368
assert_eq ! ( bufs[ 0 ] . deref( ) , [ 1 ; 7 ] . as_ref( ) ) ;
369
369
assert_eq ! ( bufs[ 1 ] . deref( ) , [ 2 ; 16 ] . as_ref( ) ) ;
370
370
assert_eq ! ( bufs[ 2 ] . deref( ) , [ 3 ; 8 ] . as_ref( ) ) ;
371
371
372
372
// Removing a buffer, leaving others as is.
373
- IoSliceMut :: advance_slice ( & mut bufs, 7 ) ;
373
+ IoSliceMut :: advance_slices ( & mut bufs, 7 ) ;
374
374
assert_eq ! ( bufs[ 0 ] . deref( ) , [ 2 ; 16 ] . as_ref( ) ) ;
375
375
assert_eq ! ( bufs[ 1 ] . deref( ) , [ 3 ; 8 ] . as_ref( ) ) ;
376
376
377
377
// Removing a buffer and removing from the next buffer.
378
- IoSliceMut :: advance_slice ( & mut bufs, 18 ) ;
378
+ IoSliceMut :: advance_slices ( & mut bufs, 18 ) ;
379
379
assert_eq ! ( bufs[ 0 ] . deref( ) , [ 3 ; 6 ] . as_ref( ) ) ;
380
380
}
381
381
382
382
#[ test]
383
- fn io_slice_mut_advance_slice_empty_slice ( ) {
383
+ fn io_slice_mut_advance_slices_empty_slice ( ) {
384
384
let mut empty_bufs = & mut [ ] [ ..] ;
385
385
// Shouldn't panic.
386
- IoSliceMut :: advance_slice ( & mut empty_bufs, 1 ) ;
386
+ IoSliceMut :: advance_slices ( & mut empty_bufs, 1 ) ;
387
387
}
388
388
389
389
#[ test]
390
- fn io_slice_mut_advance_slice_beyond_total_length ( ) {
390
+ fn io_slice_mut_advance_slices_beyond_total_length ( ) {
391
391
let mut buf1 = [ 1 ; 8 ] ;
392
392
let mut bufs = & mut [ IoSliceMut :: new ( & mut buf1) ] [ ..] ;
393
393
394
394
// Going beyond the total length should be ok.
395
- IoSliceMut :: advance_slice ( & mut bufs, 9 ) ;
395
+ IoSliceMut :: advance_slices ( & mut bufs, 9 ) ;
396
396
assert ! ( bufs. is_empty( ) ) ;
397
397
}
398
398
399
399
#[ test]
400
- fn io_slice_advance_slice ( ) {
400
+ fn io_slice_advance_slices ( ) {
401
401
let buf1 = [ 1 ; 8 ] ;
402
402
let buf2 = [ 2 ; 16 ] ;
403
403
let buf3 = [ 3 ; 8 ] ;
404
404
let mut bufs = & mut [ IoSlice :: new ( & buf1) , IoSlice :: new ( & buf2) , IoSlice :: new ( & buf3) ] [ ..] ;
405
405
406
406
// Only in a single buffer..
407
- IoSlice :: advance_slice ( & mut bufs, 1 ) ;
407
+ IoSlice :: advance_slices ( & mut bufs, 1 ) ;
408
408
assert_eq ! ( bufs[ 0 ] . deref( ) , [ 1 ; 7 ] . as_ref( ) ) ;
409
409
assert_eq ! ( bufs[ 1 ] . deref( ) , [ 2 ; 16 ] . as_ref( ) ) ;
410
410
assert_eq ! ( bufs[ 2 ] . deref( ) , [ 3 ; 8 ] . as_ref( ) ) ;
411
411
412
412
// Removing a buffer, leaving others as is.
413
- IoSlice :: advance_slice ( & mut bufs, 7 ) ;
413
+ IoSlice :: advance_slices ( & mut bufs, 7 ) ;
414
414
assert_eq ! ( bufs[ 0 ] . deref( ) , [ 2 ; 16 ] . as_ref( ) ) ;
415
415
assert_eq ! ( bufs[ 1 ] . deref( ) , [ 3 ; 8 ] . as_ref( ) ) ;
416
416
417
417
// Removing a buffer and removing from the next buffer.
418
- IoSlice :: advance_slice ( & mut bufs, 18 ) ;
418
+ IoSlice :: advance_slices ( & mut bufs, 18 ) ;
419
419
assert_eq ! ( bufs[ 0 ] . deref( ) , [ 3 ; 6 ] . as_ref( ) ) ;
420
420
}
421
421
422
422
#[ test]
423
- fn io_slice_advance_slice_empty_slice ( ) {
423
+ fn io_slice_advance_slices_empty_slice ( ) {
424
424
let mut empty_bufs = & mut [ ] [ ..] ;
425
425
// Shouldn't panic.
426
- IoSlice :: advance_slice ( & mut empty_bufs, 1 ) ;
426
+ IoSlice :: advance_slices ( & mut empty_bufs, 1 ) ;
427
427
}
428
428
429
429
#[ test]
430
- fn io_slice_advance_slice_beyond_total_length ( ) {
430
+ fn io_slice_advance_slices_beyond_total_length ( ) {
431
431
let buf1 = [ 1 ; 8 ] ;
432
432
let mut bufs = & mut [ IoSlice :: new ( & buf1) ] [ ..] ;
433
433
434
434
// Going beyond the total length should be ok.
435
- IoSlice :: advance_slice ( & mut bufs, 9 ) ;
435
+ IoSlice :: advance_slices ( & mut bufs, 9 ) ;
436
436
assert ! ( bufs. is_empty( ) ) ;
437
437
}
438
438
0 commit comments