mirror of
https://github.com/tokio-rs/bytes.git
synced 2026-08-14 00:00:13 +02:00
Reorganize crate
This commit is contained in:
+2
-34
@@ -1,4 +1,5 @@
|
||||
use bytes::{Buf, MutBuf, AppendBuf};
|
||||
use bytes::{Buf, MutBuf};
|
||||
use bytes::buf::AppendBuf;
|
||||
|
||||
#[test]
|
||||
pub fn test_initial_buf_empty() {
|
||||
@@ -27,36 +28,3 @@ pub fn test_initial_buf_empty() {
|
||||
assert_eq!(dst, b"hello world");
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
#[test]
|
||||
pub fn test_append_buf_from_pool() {
|
||||
use bytes::alloc::Pool;
|
||||
let pool = Pool::with_capacity(2, 256);
|
||||
|
||||
// Run in a loop a bunch in hope that if there is a memory issue, it will
|
||||
// be exposed
|
||||
for _ in 0..1000 {
|
||||
let mut buf = pool.new_append_buf().unwrap();
|
||||
let mut dst: Vec<u8> = vec![];
|
||||
|
||||
assert_eq!(buf.remaining(), 256);
|
||||
|
||||
buf.write_slice(b"hello world");
|
||||
assert_eq!(buf.remaining(), 245);
|
||||
assert_eq!(buf.bytes(), b"hello world");
|
||||
|
||||
let view1 = buf.slice(0, 11);
|
||||
view1.buf().copy_to(&mut dst);
|
||||
|
||||
assert_eq!(dst, b"hello world");
|
||||
assert_eq!(view1, buf.slice(0, 11));
|
||||
|
||||
drop(buf);
|
||||
let mut buf = pool.new_append_buf().unwrap();
|
||||
buf.write_slice(b"zomg no no no no");
|
||||
|
||||
assert_eq!(dst, b"hello world");
|
||||
}
|
||||
}
|
||||
*/
|
||||
|
||||
+2
-2
@@ -1,5 +1,5 @@
|
||||
use bytes::{MutBuf, BlockBuf};
|
||||
|
||||
use bytes::{MutBuf};
|
||||
use bytes::buf::{BlockBuf};
|
||||
|
||||
#[test]
|
||||
pub fn test_block_drop() {
|
||||
|
||||
+1
-1
@@ -48,7 +48,7 @@ fn test_read_u16_buffer_underflow() {
|
||||
|
||||
#[test]
|
||||
fn test_vec_sink_capacity() {
|
||||
use bytes::Sink;
|
||||
use bytes::buf::Sink;
|
||||
|
||||
let mut sink: Vec<u8> = Vec::new();
|
||||
sink.reserve(16);
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
use bytes::*;
|
||||
use bytes::buf::*;
|
||||
use std::io;
|
||||
|
||||
#[test]
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
use bytes::{Buf, MutBuf};
|
||||
use bytes::MutByteBuf;
|
||||
use bytes::buf::MutByteBuf;
|
||||
|
||||
#[test]
|
||||
pub fn test_initial_buf_empty() {
|
||||
|
||||
+2
-1
@@ -1,4 +1,5 @@
|
||||
use bytes::{RingBuf, Buf, MutBuf};
|
||||
use bytes::{Buf, MutBuf};
|
||||
use bytes::buf::RingBuf;
|
||||
|
||||
#[test]
|
||||
pub fn test_initial_buf_empty() {
|
||||
|
||||
Reference in New Issue
Block a user