diff --git a/src/lib.rs b/src/lib.rs index 0d15e785de0e279483499dcc139a841045d9c987..aa1f80a564422df408dd56f7bbd5a1d71743bd17 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -33,11 +33,6 @@ pub use str::{ 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; diff --git a/src/str/bytes.rs b/src/str/bytes.rs index 12667573b0b7b8488f3b02a50ad939d8ca2ee12d..191a67ae742e390728cb1d659b10e161eca94efd 100644 --- a/src/str/bytes.rs +++ b/src/str/bytes.rs @@ -1,5 +1,6 @@ use {ByteBuf, SmallByteStr}; -use traits::{Buf, ByteStr, ToBytes}; +use buf::{Buf}; +use str::{ByteStr, ToBytes}; use std::{fmt, mem, ops, ptr}; use std::any::{TypeId}; diff --git a/src/str/rope.rs b/src/str/rope.rs index ec7b807608c3587f5c2bcbe651b7417c7791e4af..693b88925451cbab1f65f2d65a573c4429138217 100644 --- a/src/str/rope.rs +++ b/src/str/rope.rs @@ -1,5 +1,6 @@ use {Bytes, ByteBuf}; -use traits::{Buf, ByteStr, MutBuf, ToBytes}; +use buf::{Buf, MutBuf}; +use str::{ByteStr, ToBytes}; use std::{cmp, mem, ops}; use std::sync::Arc; diff --git a/src/str/small.rs b/src/str/small.rs index 9128a95495f769056478a787a716ea978c5768af..c40ad9b07b3a68087113e5880eca161ea5cc6c3c 100644 --- a/src/str/small.rs +++ b/src/str/small.rs @@ -1,5 +1,6 @@ use {Bytes, Rope}; -use traits::{Buf, ByteStr, ToBytes}; +use buf::Buf; +use str::{ByteStr, ToBytes}; use std::{cmp, ops}; /* diff --git a/test/test_byte_buf.rs b/test/test_byte_buf.rs index 110da8ae0243a6f25fac71ebb7556656d1a593fd..76709c44b4c1d4130dcf6add0b7a81fe817a4b2d 100644 --- a/test/test_byte_buf.rs +++ b/test/test_byte_buf.rs @@ -1,5 +1,5 @@ +use bytes::{Buf, MutBuf}; use bytes::ByteBuf; -use bytes::traits::*; #[test] pub fn test_initial_buf_empty() { diff --git a/test/test_ring.rs b/test/test_ring.rs index f42219fb0f00f1f19b2fc88f9b1a70aae6bd0238..74dc6bc433feea55e428b51494facf9b9ac31ed2 100644 --- a/test/test_ring.rs +++ b/test/test_ring.rs @@ -2,8 +2,6 @@ use bytes::{RingBuf, Buf, MutBuf}; #[test] pub fn test_initial_buf_empty() { - use bytes::traits::{Buf, MutBuf}; - let mut buf = RingBuf::new(16); assert_eq!(MutBuf::remaining(&buf), 16); 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 // full buffer to zero. fn test_reset_full() { - use bytes::traits::MutBuf; - let mut buf = RingBuf::new(8); buf.copy_from(&[1, 2, 3, 4, 5, 6, 7, 8][..]).unwrap(); assert_eq!(MutBuf::remaining(&buf), 0); @@ -116,8 +112,6 @@ fn test_reset_full() { #[test] // Test that "RingBuf::clear" does the full reset fn test_clear() { - use bytes::traits::{Buf, MutBuf}; - let mut buf = RingBuf::new(8); buf.copy_from(&[0; 8][..]).unwrap(); assert_eq!(MutBuf::remaining(&buf), 0); diff --git a/test/test_rope.rs b/test/test_rope.rs index ded1cd528f514dac7478e44a14efbb8e6d7be853..f9a2f0ca04f4b7c012942d4742526ce4548d5ca0 100644 --- a/test/test_rope.rs +++ b/test/test_rope.rs @@ -1,5 +1,4 @@ -use bytes::Rope; -use bytes::traits::*; +use bytes::{Buf, Rope, ByteStr, ToBytes}; use super::gen_bytes; const TEST_BYTES_1: &'static [u8] = diff --git a/test/test_seq_byte_str.rs b/test/test_seq_byte_str.rs index 9e5508e8f9ca7edf3874c647ca0e9e76e6ec34c0..0a8dd8139ca972b3f31b85e315a3fbd33e0aaec4 100644 --- a/test/test_seq_byte_str.rs +++ b/test/test_seq_byte_str.rs @@ -1,5 +1,4 @@ -use bytes::SeqByteStr; -use bytes::traits::*; +use bytes::{ByteStr, Buf, SeqByteStr}; use super::gen_bytes; #[test] diff --git a/test/test_small_byte_str.rs b/test/test_small_byte_str.rs index 454e2d588437dc8cd3b417a8de97e62058938455..07820a8df55ee259d44609b4a366691e3a425e17 100644 --- a/test/test_small_byte_str.rs +++ b/test/test_small_byte_str.rs @@ -1,5 +1,4 @@ -use bytes::SmallByteStr; -use bytes::traits::*; +use bytes::{ByteStr, Buf, SmallByteStr}; use super::gen_bytes; #[test]