diff --git a/src/body.rs b/src/body.rs
index 97b8850c..64123679 100644
--- a/src/body.rs
+++ b/src/body.rs
@@ -281,61 +281,61 @@ mod tests {
#[test]
fn test_static_str() {
assert_eq!(Binary::from("test").len(), 4);
- assert_eq!(Binary::from("test").as_ref(), "test".as_bytes());
+ assert_eq!(Binary::from("test").as_ref(), b"test");
}
#[test]
fn test_static_bytes() {
assert_eq!(Binary::from(b"test".as_ref()).len(), 4);
- assert_eq!(Binary::from(b"test".as_ref()).as_ref(), "test".as_bytes());
+ assert_eq!(Binary::from(b"test".as_ref()).as_ref(), b"test");
assert_eq!(Binary::from_slice(b"test".as_ref()).len(), 4);
- assert_eq!(Binary::from_slice(b"test".as_ref()).as_ref(), "test".as_bytes());
+ assert_eq!(Binary::from_slice(b"test".as_ref()).as_ref(), b"test");
}
#[test]
fn test_vec() {
assert_eq!(Binary::from(Vec::from("test")).len(), 4);
- assert_eq!(Binary::from(Vec::from("test")).as_ref(), "test".as_bytes());
+ assert_eq!(Binary::from(Vec::from("test")).as_ref(), b"test");
}
#[test]
fn test_bytes() {
assert_eq!(Binary::from(Bytes::from("test")).len(), 4);
- assert_eq!(Binary::from(Bytes::from("test")).as_ref(), "test".as_bytes());
+ assert_eq!(Binary::from(Bytes::from("test")).as_ref(), b"test");
}
#[test]
fn test_ref_string() {
let b = Rc::new("test".to_owned());
assert_eq!(Binary::from(&b).len(), 4);
- assert_eq!(Binary::from(&b).as_ref(), "test".as_bytes());
+ assert_eq!(Binary::from(&b).as_ref(), b"test");
}
#[test]
fn test_rc_string() {
let b = Rc::new("test".to_owned());
assert_eq!(Binary::from(b.clone()).len(), 4);
- assert_eq!(Binary::from(b.clone()).as_ref(), "test".as_bytes());
+ assert_eq!(Binary::from(b.clone()).as_ref(), b"test");
assert_eq!(Binary::from(&b).len(), 4);
- assert_eq!(Binary::from(&b).as_ref(), "test".as_bytes());
+ assert_eq!(Binary::from(&b).as_ref(), b"test");
}
#[test]
fn test_arc_string() {
let b = Arc::new("test".to_owned());
assert_eq!(Binary::from(b.clone()).len(), 4);
- assert_eq!(Binary::from(b.clone()).as_ref(), "test".as_bytes());
+ assert_eq!(Binary::from(b.clone()).as_ref(), b"test");
assert_eq!(Binary::from(&b).len(), 4);
- assert_eq!(Binary::from(&b).as_ref(), "test".as_bytes());
+ assert_eq!(Binary::from(&b).as_ref(), b"test");
}
#[test]
fn test_string() {
let b = "test".to_owned();
assert_eq!(Binary::from(b.clone()).len(), 4);
- assert_eq!(Binary::from(b.clone()).as_ref(), "test".as_bytes());
+ assert_eq!(Binary::from(b.clone()).as_ref(), b"test");
assert_eq!(Binary::from(&b).len(), 4);
- assert_eq!(Binary::from(&b).as_ref(), "test".as_bytes());
+ assert_eq!(Binary::from(&b).as_ref(), b"test");
}
#[test]
@@ -351,7 +351,7 @@ mod tests {
fn test_bytes_mut() {
let b = BytesMut::from("test");
assert_eq!(Binary::from(b.clone()).len(), 4);
- assert_eq!(Binary::from(b).as_ref(), "test".as_bytes());
+ assert_eq!(Binary::from(b).as_ref(), b"test");
}
#[test]
diff --git a/src/middleware/logger.rs b/src/middleware/logger.rs
index 48a8d3db..32d2ef4d 100644
--- a/src/middleware/logger.rs
+++ b/src/middleware/logger.rs
@@ -319,7 +319,7 @@ mod tests {
}
let entry_time = time::now();
let render = |fmt: &mut Formatter| {
- for unit in logger.format.0.iter() {
+ for unit in &logger.format.0 {
unit.render(fmt, &req, &resp, entry_time)?;
}
Ok(())
@@ -340,7 +340,7 @@ mod tests {
let entry_time = time::now();
let render = |fmt: &mut Formatter| {
- for unit in format.0.iter() {
+ for unit in &format.0 {
unit.render(fmt, &req, &resp, entry_time)?;
}
Ok(())
@@ -357,7 +357,7 @@ mod tests {
let entry_time = time::now();
let render = |fmt: &mut Formatter| {
- for unit in format.0.iter() {
+ for unit in &format.0 {
unit.render(fmt, &req, &resp, entry_time)?;
}
Ok(())
diff --git a/src/server/h1.rs b/src/server/h1.rs
index cb2e0b04..66fdf8a7 100644
--- a/src/server/h1.rs
+++ b/src/server/h1.rs
@@ -1425,7 +1425,7 @@ mod tests {
let mut reader = Reader::new();
let mut req = reader_parse_ready!(reader.parse(&mut buf, &mut readbuf, &settings));
- let _ = req.payload_mut().set_read_buffer_capacity(0);
+ req.payload_mut().set_read_buffer_capacity(0);
assert!(req.chunked().unwrap());
assert!(!req.payload().eof());
diff --git a/src/ws/frame.rs b/src/ws/frame.rs
index 2afcd035..cb3e82fe 100644
--- a/src/ws/frame.rs
+++ b/src/ws/frame.rs
@@ -354,8 +354,8 @@ mod tests {
use super::*;
use futures::stream::once;
- fn is_none(frm: Poll