Skip to content
Permalink
Browse files

tidy

  • Loading branch information...
sfackler committed Apr 27, 2019
1 parent bd177f3 commit 89ff7cde5a81e1e1022498d24a03c816b79d9d68
Showing with 24 additions and 10 deletions.
  1. +2 −1 src/libstd/io/buffered.rs
  2. +20 −7 src/libstd/io/cursor.rs
  3. +2 −2 src/libstd/io/impls.rs
@@ -5,7 +5,8 @@ use crate::io::prelude::*;
use crate::cmp;
use crate::error;
use crate::fmt;
use crate::io::{self, Initializer, DEFAULT_BUF_SIZE, Error, ErrorKind, SeekFrom, IoSlice, IoSliceMut};
use crate::io::{self, Initializer, DEFAULT_BUF_SIZE, Error, ErrorKind, SeekFrom, IoSlice,
IoSliceMut};
use crate::memchr;

/// The `BufReader` struct adds buffering to any reader.
@@ -455,7 +455,10 @@ mod tests {
assert_eq!(writer.write_vectored(&[IoSlice::new(&[0])]).unwrap(), 1);
assert_eq!(writer.position(), 1);
assert_eq!(
writer.write_vectored(&[IoSlice::new(&[1, 2, 3]), IoSlice::new(&[4, 5, 6, 7])]).unwrap(),
writer.write_vectored(&[
IoSlice::new(&[1, 2, 3]),
IoSlice::new(&[4, 5, 6, 7]),
]).unwrap(),
7,
);
assert_eq!(writer.position(), 8);
@@ -582,7 +585,10 @@ mod tests {
assert_eq!(reader.position(), 0);
let mut buf = [0];
assert_eq!(
reader.read_vectored(&mut [IoSliceMut::new(&mut []), IoSliceMut::new(&mut buf)]).unwrap(),
reader.read_vectored(&mut [
IoSliceMut::new(&mut []),
IoSliceMut::new(&mut buf),
]).unwrap(),
1,
);
assert_eq!(reader.position(), 1);
@@ -591,9 +597,10 @@ mod tests {
let mut buf1 = [0; 4];
let mut buf2 = [0; 4];
assert_eq!(
reader.read_vectored(
&mut [IoSliceMut::new(&mut buf1), IoSliceMut::new(&mut buf2)],
).unwrap(),
reader.read_vectored(&mut [
IoSliceMut::new(&mut buf1),
IoSliceMut::new(&mut buf2),
]).unwrap(),
7,
);
let b1: &[_] = &[1, 2, 3, 4];
@@ -633,7 +640,10 @@ mod tests {
assert_eq!(reader.position(), 0);
let mut buf = [0];
assert_eq!(
reader.read_vectored(&mut [IoSliceMut::new(&mut []), IoSliceMut::new(&mut buf)]).unwrap(),
reader.read_vectored(&mut [
IoSliceMut::new(&mut []),
IoSliceMut::new(&mut buf),
]).unwrap(),
1,
);
assert_eq!(reader.position(), 1);
@@ -692,7 +702,10 @@ mod tests {
assert_eq!(reader.read_vectored(&mut [IoSliceMut::new(&mut buf)]).unwrap(), 0);
let mut buf = [0];
assert_eq!(
reader.read_vectored(&mut [IoSliceMut::new(&mut []), IoSliceMut::new(&mut buf)]).unwrap(),
reader.read_vectored(&mut [
IoSliceMut::new(&mut []),
IoSliceMut::new(&mut buf),
]).unwrap(),
1,
);
assert_eq!(reader.len(), 7);
@@ -1,6 +1,6 @@
use crate::cmp;
use crate::io::{self, SeekFrom, Read, Initializer, Write, Seek, BufRead, Error, ErrorKind, IoSliceMut,
IoSlice};
use crate::io::{self, SeekFrom, Read, Initializer, Write, Seek, BufRead, Error, ErrorKind,
IoSliceMut, IoSlice};
use crate::fmt;
use crate::mem;

0 comments on commit 89ff7cd

Please sign in to comment.
You can’t perform that action at this time.