diff options
author | 2020-05-22 13:17:30 +0900 | |
---|---|---|
committer | 2020-05-22 13:17:30 +0900 | |
commit | 1fbf83816b60fbaa2f9e85585338138c3efa949f (patch) | |
tree | 859b49f1db1bf180a58045772f585b2ad5909379 /tests/test_bytes.rs | |
parent | 5e93fa4c6b3d6209329a3a9c90c6823886affea1 (diff) | |
download | bytes-1fbf83816b60fbaa2f9e85585338138c3efa949f.tar.gz bytes-1fbf83816b60fbaa2f9e85585338138c3efa949f.tar.zst bytes-1fbf83816b60fbaa2f9e85585338138c3efa949f.zip |
Format with rustfmt (#389)
* Format with rustfmt
* Add rustfmt check to CI
Diffstat (limited to 'tests/test_bytes.rs')
-rw-r--r-- | tests/test_bytes.rs | 12 |
1 files changed, 5 insertions, 7 deletions
diff --git a/tests/test_bytes.rs b/tests/test_bytes.rs index 4775773..106fa6f 100644 --- a/tests/test_bytes.rs +++ b/tests/test_bytes.rs @@ -1,6 +1,6 @@ #![deny(warnings, rust_2018_idioms)] -use bytes::{Bytes, BytesMut, Buf, BufMut}; +use bytes::{Buf, BufMut, Bytes, BytesMut}; use std::usize; @@ -44,7 +44,6 @@ fn test_layout() { mem::size_of::<Option<BytesMut>>(), "BytesMut should be same size as Option<BytesMut>", ); - } #[test] @@ -87,13 +86,11 @@ fn fmt_write() { write!(a, "{}", &s[..64]).unwrap(); assert_eq!(a, s[..64].as_bytes()); - let mut b = BytesMut::with_capacity(64); write!(b, "{}", &s[..32]).unwrap(); write!(b, "{}", &s[32..64]).unwrap(); assert_eq!(b, s[..64].as_bytes()); - let mut c = BytesMut::with_capacity(64); write!(c, "{}", s).unwrap(); assert_eq!(c, s[..].as_bytes()); @@ -305,11 +302,13 @@ fn split_off_to_at_gt_len() { assert!(panic::catch_unwind(move || { let _ = make_bytes().split_to(5); - }).is_err()); + }) + .is_err()); assert!(panic::catch_unwind(move || { let _ = make_bytes().split_off(5); - }).is_err()); + }) + .is_err()); } #[test] @@ -864,7 +863,6 @@ fn slice_ref_works() { test_slice_ref(&bytes, 9, 9, b""); } - #[test] fn slice_ref_empty() { let bytes = Bytes::from(&b""[..]); |