mirror of
https://github.com/edg-l/rustyman.git
synced 2024-11-09 09:38:20 +00:00
eagerly derive all possible derives, more docs, new version
This commit is contained in:
parent
9ec8459253
commit
f8e093a19b
|
@ -1,6 +1,6 @@
|
||||||
[package]
|
[package]
|
||||||
name = "rustyman"
|
name = "rustyman"
|
||||||
version = "0.2.2"
|
version = "0.2.3"
|
||||||
edition = "2021"
|
edition = "2021"
|
||||||
authors = ["Edgar <git@edgarluque.com>"]
|
authors = ["Edgar <git@edgarluque.com>"]
|
||||||
description = "Huffman compression and decompression"
|
description = "Huffman compression and decompression"
|
||||||
|
|
10
src/lib.rs
10
src/lib.rs
|
@ -22,6 +22,10 @@
|
||||||
//! assert_eq!(&payload[..], decompressed);
|
//! assert_eq!(&payload[..], decompressed);
|
||||||
//! ```
|
//! ```
|
||||||
|
|
||||||
|
#![forbid(unsafe_code)]
|
||||||
|
#![deny(missing_docs)]
|
||||||
|
#![deny(rustdoc::missing_doc_code_examples)]
|
||||||
|
|
||||||
use std::{
|
use std::{
|
||||||
cell::RefCell,
|
cell::RefCell,
|
||||||
collections::{BinaryHeap, HashMap},
|
collections::{BinaryHeap, HashMap},
|
||||||
|
@ -77,7 +81,11 @@ impl Ord for Node {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Debug, Clone)]
|
/// Holds the data needed to (de)compress.
|
||||||
|
///
|
||||||
|
/// - Compress with [Self::compress]
|
||||||
|
/// - Decompress with [Self::decompress]
|
||||||
|
#[derive(Debug, Clone, PartialEq, Eq)]
|
||||||
pub struct Huffman {
|
pub struct Huffman {
|
||||||
tree: Vec<Node>,
|
tree: Vec<Node>,
|
||||||
// index lookup table for the leaf nodes.
|
// index lookup table for the leaf nodes.
|
||||||
|
|
Loading…
Reference in a new issue