Format with rustfmt (#389)

* Format with rustfmt

* Add rustfmt check to CI
This commit is contained in:
Taiki Endo
2020-05-22 13:17:30 +09:00
committed by GitHub
parent 5e93fa4c6b
commit 1fbf83816b
27 changed files with 410 additions and 331 deletions
+5 -7
View File
@@ -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""[..]);