mirror of
https://github.com/tokio-rs/bytes.git
synced 2026-08-14 00:00:13 +02:00
Format with rustfmt (#389)
* Format with rustfmt * Add rustfmt check to CI
This commit is contained in:
+5
-7
@@ -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""[..]);
|
||||
|
||||
Reference in New Issue
Block a user