Skip to content

Commit

Permalink
tidy
Browse files Browse the repository at this point in the history
  • Loading branch information
sfackler committed Apr 27, 2019
1 parent bd177f3 commit 89ff7cd
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 10 deletions.
3 changes: 2 additions & 1 deletion src/libstd/io/buffered.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
27 changes: 20 additions & 7 deletions src/libstd/io/cursor.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down Expand Up @@ -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);
Expand All @@ -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];
Expand Down Expand Up @@ -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);
Expand Down Expand Up @@ -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);
Expand Down
4 changes: 2 additions & 2 deletions src/libstd/io/impls.rs
Original file line number Diff line number Diff line change
@@ -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;

Expand Down

0 comments on commit 89ff7cd

Please sign in to comment.