From 89ff7cde5a81e1e1022498d24a03c816b79d9d68 Mon Sep 17 00:00:00 2001 From: Steven Fackler Date: Sat, 27 Apr 2019 09:19:34 -0700 Subject: [PATCH] tidy --- src/libstd/io/buffered.rs | 3 ++- src/libstd/io/cursor.rs | 27 ++++++++++++++++++++------- src/libstd/io/impls.rs | 4 ++-- 3 files changed, 24 insertions(+), 10 deletions(-) diff --git a/src/libstd/io/buffered.rs b/src/libstd/io/buffered.rs index 6a9f7b90fff8f..6eba1033a417d 100644 --- a/src/libstd/io/buffered.rs +++ b/src/libstd/io/buffered.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. diff --git a/src/libstd/io/cursor.rs b/src/libstd/io/cursor.rs index 872aa1f370193..64f8659b8f8fe 100644 --- a/src/libstd/io/cursor.rs +++ b/src/libstd/io/cursor.rs @@ -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); diff --git a/src/libstd/io/impls.rs b/src/libstd/io/impls.rs index 7b866049d7ef1..c959f2d389b11 100644 --- a/src/libstd/io/impls.rs +++ b/src/libstd/io/impls.rs @@ -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;