diff options
Diffstat (limited to 'buffered-reader')
-rw-r--r-- | buffered-reader/src/decompress_deflate.rs | 2 | ||||
-rw-r--r-- | buffered-reader/src/dup.rs | 2 | ||||
-rw-r--r-- | buffered-reader/src/generic.rs | 2 | ||||
-rw-r--r-- | buffered-reader/src/lib.rs | 6 | ||||
-rw-r--r-- | buffered-reader/src/limitor.rs | 2 | ||||
-rw-r--r-- | buffered-reader/src/memory.rs | 2 |
6 files changed, 8 insertions, 8 deletions
diff --git a/buffered-reader/src/decompress_deflate.rs b/buffered-reader/src/decompress_deflate.rs index d713413a..1bb0bc4f 100644 --- a/buffered-reader/src/decompress_deflate.rs +++ b/buffered-reader/src/decompress_deflate.rs @@ -294,7 +294,7 @@ mod test { for i in 0..input_raw.len() { let data = reader.data(DEFAULT_BUF_SIZE + 1).unwrap().to_vec(); - assert!(data.len() > 0); + assert!(!data.is_empty()); assert_eq!(data, reader.buffer()); // And, we may as well check to make sure we read the // right data. diff --git a/buffered-reader/src/dup.rs b/buffered-reader/src/dup.rs index df4a6e2f..c63ab9c8 100644 --- a/buffered-reader/src/dup.rs +++ b/buffered-reader/src/dup.rs @@ -194,7 +194,7 @@ mod test { for i in 0..input.len() { let data = reader.data(DEFAULT_BUF_SIZE + 1).unwrap().to_vec(); - assert!(data.len() > 0); + assert!(!data.is_empty()); assert_eq!(data, reader.buffer()); // And, we may as well check to make sure we read the // right data. diff --git a/buffered-reader/src/generic.rs b/buffered-reader/src/generic.rs index 19f799eb..aa72e1b4 100644 --- a/buffered-reader/src/generic.rs +++ b/buffered-reader/src/generic.rs @@ -351,7 +351,7 @@ mod test { for i in 0..input.len() { let data = reader.data(DEFAULT_BUF_SIZE + 1).unwrap().to_vec(); - assert!(data.len() > 0); + assert!(!data.is_empty()); assert_eq!(data, reader.buffer()); // And, we may as well check to make sure we read the // right data. diff --git a/buffered-reader/src/lib.rs b/buffered-reader/src/lib.rs index 18fdbaee..ed5a4724 100644 --- a/buffered-reader/src/lib.rs +++ b/buffered-reader/src/lib.rs @@ -723,13 +723,13 @@ pub trait BufferedReader<C> : io::Read + fmt::Debug + fmt::Display + Send + Sync let len = { // Try self.buffer. Only if it is empty, use // self.data. - let buffer = if self.buffer().len() == 0 { + let buffer = if self.buffer().is_empty() { self.data(DEFAULT_BUF_SIZE)? } else { self.buffer() }; - if buffer.len() == 0 { + if buffer.is_empty() { break 'outer 0; } @@ -1096,7 +1096,7 @@ mod test { { let result = bio.data(buffer.len()); let buffer = result.unwrap(); - if buffer.len() > 0 { + if !buffer.is_empty() { assert_eq!(buffer, &data[data_start..data_start + buffer.len()]); } diff --git a/buffered-reader/src/limitor.rs b/buffered-reader/src/limitor.rs index c20edced..e7260c3b 100644 --- a/buffered-reader/src/limitor.rs +++ b/buffered-reader/src/limitor.rs @@ -266,7 +266,7 @@ mod test { for i in 0..input.len() { let data = reader.data(DEFAULT_BUF_SIZE + 1).unwrap().to_vec(); - assert!(data.len() > 0); + assert!(!data.is_empty()); assert_eq!(data, reader.buffer()); // And, we may as well check to make sure we read the // right data. diff --git a/buffered-reader/src/memory.rs b/buffered-reader/src/memory.rs index a177c6c0..6fb9e338 100644 --- a/buffered-reader/src/memory.rs +++ b/buffered-reader/src/memory.rs @@ -167,7 +167,7 @@ mod test { for i in 0..input.len() { let data = reader.data(DEFAULT_BUF_SIZE + 1).unwrap().to_vec(); - assert!(data.len() > 0); + assert!(!data.is_empty()); assert_eq!(data, reader.buffer()); // And, we may as well check to make sure we read the // right data. |