Skip to content

Commit 439f673

Browse files
committed
Fix docs on crate level + moved docs to correct place
1 parent f49da07 commit 439f673

File tree

3 files changed

+15
-8
lines changed

3 files changed

+15
-8
lines changed

CHANGELOG.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,11 @@
33
The format is based on [Keep a Changelog](http://keepachangelog.com/)
44
and this project adheres to [Semantic Versioning](http://semver.org/).
55

6+
## [0.1.2] -- 2017.01.07
7+
### Fixed
8+
- Documentation on Reader
9+
- Crate level docs
10+
611
## [0.1.1] -- 2017.01.07
712
### Fixed
813
- Links to docs

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "huffman-coding"
3-
version = "0.1.1"
3+
version = "0.1.2"
44
authors = ["WanzenBug <[email protected]>"]
55
description = "Crate for doing pure huffman coding"
66
license = "MIT"

src/lib.rs

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
11
//! **huffman_coding** is a small library for reading and writing huffman encoded data
22
//!
3-
//! There are only 3 things you need to know
3+
//! There are only 3 things you need to know:
4+
//! * Use HuffmanTree to change the coding and decoding based on your data
5+
//! * Use HuffmanWriter to encode data
6+
//! * use HuffmanReader to decode data
47
58
extern crate bitstream;
69
extern crate bit_vec;
@@ -223,7 +226,6 @@ impl HuffmanTree {
223226
/// inner writer.
224227
///
225228
/// # Examples
226-
///
227229
/// ```
228230
/// extern crate huffman_coding;
229231
/// let pseudo_data = vec![0, 0, 1, 2, 2];
@@ -268,11 +270,6 @@ impl<W> Write for HuffmanWriter<W> where W: Write {
268270
}
269271
}
270272

271-
pub struct HuffmanReader<R> where R: Read {
272-
inner: bitstream::BitReader<R>,
273-
tree: HuffmanTree,
274-
}
275-
276273
/// *HuffmanReader* is a Read implementation that can read encoded words from the inner reader
277274
///
278275
/// # Examples
@@ -289,6 +286,11 @@ pub struct HuffmanReader<R> where R: Read {
289286
/// assert!(reader.read_exact(&mut buffer[..]).is_ok());
290287
/// assert_eq!(&buffer[..], &[2, 2, 0, 0, 1]);
291288
/// ```
289+
pub struct HuffmanReader<R> where R: Read {
290+
inner: bitstream::BitReader<R>,
291+
tree: HuffmanTree,
292+
}
293+
292294
impl<R> HuffmanReader<R> where R: Read {
293295
/// Construct a new reader, using the provided HuffmanTree for decoding
294296
pub fn new(reader: R, tree: HuffmanTree) -> Self {

0 commit comments

Comments
 (0)