diff options
-rw-r--r-- | src/buffered_reader/buffered_reader.rs | 25 | ||||
-rw-r--r-- | src/openpgp/parse/parse.rs | 7 |
2 files changed, 17 insertions, 15 deletions
diff --git a/src/buffered_reader/buffered_reader.rs b/src/buffered_reader/buffered_reader.rs index 5d5727b5..ebcb4dc9 100644 --- a/src/buffered_reader/buffered_reader.rs +++ b/src/buffered_reader/buffered_reader.rs @@ -5,18 +5,23 @@ use std::io::{Error,ErrorKind}; use std::cmp; use std::fmt; +mod generic; +mod memory; +mod limitor; +mod partial_body; +mod decompress; + +pub use self::generic::BufferedReaderGeneric; +pub use self::memory::BufferedReaderMemory; +pub use self::limitor::BufferedReaderLimitor; +pub use self::partial_body::BufferedReaderPartialBodyFilter; +pub use self::decompress::BufferedReaderDeflate; +pub use self::decompress::BufferedReaderZlib; +pub use self::decompress::BufferedReaderBzip; + // The default buffer size. const DEFAULT_BUF_SIZE: usize = 8 * 1024; -pub mod decompress; -pub mod partial_body; -pub mod generic; -pub use self::generic::*; -pub mod memory; -pub use self::memory::*; -pub mod limitor; -pub use self::limitor::*; - /// A `BufferedReader` is a type of `Read`er that has an internal /// buffer, and allows working directly from that buffer. Like a /// `BufRead`er, the internal buffer amortizes system calls. And, @@ -172,7 +177,7 @@ pub trait BufferedReader : io::Read + fmt::Debug { /// /// but, alas, Rust doesn't like that ("error[E0119]: conflicting /// implementations of trait `std::io::Read` for type `&mut _`"). -pub fn buffered_reader_generic_read_impl<T: BufferedReader> +fn buffered_reader_generic_read_impl<T: BufferedReader> (bio: &mut T, buf: &mut [u8]) -> Result<usize, io::Error> { match bio.data_consume(buf.len()) { Ok(inner) => { diff --git a/src/openpgp/parse/parse.rs b/src/openpgp/parse/parse.rs index 6906aa21..2da11831 100644 --- a/src/openpgp/parse/parse.rs +++ b/src/openpgp/parse/parse.rs @@ -3,13 +3,10 @@ use std::fs::File; use num::FromPrimitive; +use ::buffered_reader::*; + use super::*; -use ::buffered_reader::*; -use ::buffered_reader::partial_body::*; -use ::buffered_reader::decompress::BufferedReaderDeflate; -use ::buffered_reader::decompress::BufferedReaderZlib; -use ::buffered_reader::decompress::BufferedReaderBzip; /// The default amount of acceptable nesting. Typically, we expect a /// message to looking like: |