mirror of
https://github.com/tokio-rs/bytes.git
synced 2026-08-23 00:00:13 +02:00
Remove traits mod
This commit is contained in:
@@ -33,11 +33,6 @@ pub use str::{
|
|||||||
|
|
||||||
use std::u32;
|
use std::u32;
|
||||||
|
|
||||||
pub mod traits {
|
|
||||||
//! All traits are re-exported here to allow glob imports.
|
|
||||||
pub use {Buf, MutBuf, ByteStr, ToBytes};
|
|
||||||
}
|
|
||||||
|
|
||||||
const MAX_CAPACITY: usize = u32::MAX as usize;
|
const MAX_CAPACITY: usize = u32::MAX as usize;
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
+2
-1
@@ -1,5 +1,6 @@
|
|||||||
use {ByteBuf, SmallByteStr};
|
use {ByteBuf, SmallByteStr};
|
||||||
use traits::{Buf, ByteStr, ToBytes};
|
use buf::{Buf};
|
||||||
|
use str::{ByteStr, ToBytes};
|
||||||
use std::{fmt, mem, ops, ptr};
|
use std::{fmt, mem, ops, ptr};
|
||||||
use std::any::{TypeId};
|
use std::any::{TypeId};
|
||||||
|
|
||||||
|
|||||||
+2
-1
@@ -1,5 +1,6 @@
|
|||||||
use {Bytes, ByteBuf};
|
use {Bytes, ByteBuf};
|
||||||
use traits::{Buf, ByteStr, MutBuf, ToBytes};
|
use buf::{Buf, MutBuf};
|
||||||
|
use str::{ByteStr, ToBytes};
|
||||||
use std::{cmp, mem, ops};
|
use std::{cmp, mem, ops};
|
||||||
use std::sync::Arc;
|
use std::sync::Arc;
|
||||||
|
|
||||||
|
|||||||
+2
-1
@@ -1,5 +1,6 @@
|
|||||||
use {Bytes, Rope};
|
use {Bytes, Rope};
|
||||||
use traits::{Buf, ByteStr, ToBytes};
|
use buf::Buf;
|
||||||
|
use str::{ByteStr, ToBytes};
|
||||||
use std::{cmp, ops};
|
use std::{cmp, ops};
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
|
use bytes::{Buf, MutBuf};
|
||||||
use bytes::ByteBuf;
|
use bytes::ByteBuf;
|
||||||
use bytes::traits::*;
|
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
pub fn test_initial_buf_empty() {
|
pub fn test_initial_buf_empty() {
|
||||||
|
|||||||
@@ -2,8 +2,6 @@ use bytes::{RingBuf, Buf, MutBuf};
|
|||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
pub fn test_initial_buf_empty() {
|
pub fn test_initial_buf_empty() {
|
||||||
use bytes::traits::{Buf, MutBuf};
|
|
||||||
|
|
||||||
let mut buf = RingBuf::new(16);
|
let mut buf = RingBuf::new(16);
|
||||||
assert_eq!(MutBuf::remaining(&buf), 16);
|
assert_eq!(MutBuf::remaining(&buf), 16);
|
||||||
assert_eq!(Buf::remaining(&buf), 0);
|
assert_eq!(Buf::remaining(&buf), 0);
|
||||||
@@ -102,8 +100,6 @@ fn test_mark_write() {
|
|||||||
// Test that "RingBuf::reset" does not reset the length of a
|
// Test that "RingBuf::reset" does not reset the length of a
|
||||||
// full buffer to zero.
|
// full buffer to zero.
|
||||||
fn test_reset_full() {
|
fn test_reset_full() {
|
||||||
use bytes::traits::MutBuf;
|
|
||||||
|
|
||||||
let mut buf = RingBuf::new(8);
|
let mut buf = RingBuf::new(8);
|
||||||
buf.copy_from(&[1, 2, 3, 4, 5, 6, 7, 8][..]).unwrap();
|
buf.copy_from(&[1, 2, 3, 4, 5, 6, 7, 8][..]).unwrap();
|
||||||
assert_eq!(MutBuf::remaining(&buf), 0);
|
assert_eq!(MutBuf::remaining(&buf), 0);
|
||||||
@@ -116,8 +112,6 @@ fn test_reset_full() {
|
|||||||
#[test]
|
#[test]
|
||||||
// Test that "RingBuf::clear" does the full reset
|
// Test that "RingBuf::clear" does the full reset
|
||||||
fn test_clear() {
|
fn test_clear() {
|
||||||
use bytes::traits::{Buf, MutBuf};
|
|
||||||
|
|
||||||
let mut buf = RingBuf::new(8);
|
let mut buf = RingBuf::new(8);
|
||||||
buf.copy_from(&[0; 8][..]).unwrap();
|
buf.copy_from(&[0; 8][..]).unwrap();
|
||||||
assert_eq!(MutBuf::remaining(&buf), 0);
|
assert_eq!(MutBuf::remaining(&buf), 0);
|
||||||
|
|||||||
+1
-2
@@ -1,5 +1,4 @@
|
|||||||
use bytes::Rope;
|
use bytes::{Buf, Rope, ByteStr, ToBytes};
|
||||||
use bytes::traits::*;
|
|
||||||
use super::gen_bytes;
|
use super::gen_bytes;
|
||||||
|
|
||||||
const TEST_BYTES_1: &'static [u8] =
|
const TEST_BYTES_1: &'static [u8] =
|
||||||
|
|||||||
@@ -1,5 +1,4 @@
|
|||||||
use bytes::SeqByteStr;
|
use bytes::{ByteStr, Buf, SeqByteStr};
|
||||||
use bytes::traits::*;
|
|
||||||
use super::gen_bytes;
|
use super::gen_bytes;
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
|
|||||||
@@ -1,5 +1,4 @@
|
|||||||
use bytes::SmallByteStr;
|
use bytes::{ByteStr, Buf, SmallByteStr};
|
||||||
use bytes::traits::*;
|
|
||||||
use super::gen_bytes;
|
use super::gen_bytes;
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
|
|||||||
Reference in New Issue
Block a user