Fix tests for no_std build (#384)

This fixes `cargo test --no-default-features`.
This commit is contained in:
Cheng XU
2020-05-22 11:18:20 +09:00
committed by GitHub
parent fa464ca483
commit e8fa2511ff
4 changed files with 11 additions and 3 deletions
+2
View File
@@ -2,6 +2,7 @@
use bytes::{Buf, BufMut, Bytes};
use bytes::buf::{BufExt, BufMutExt};
#[cfg(feature = "std")]
use std::io::IoSlice;
#[test]
@@ -42,6 +43,7 @@ fn iterating_two_bufs() {
assert_eq!(res, &b"helloworld"[..]);
}
#[cfg(feature = "std")]
#[test]
fn vectored_read() {
let a = Bytes::from(&b"hello"[..]);