Skip to content

Commit 75b83aa

Browse files
authored
move traits into a 'core' crate (#19)
1 parent dc961cd commit 75b83aa

File tree

15 files changed

+74
-20
lines changed

15 files changed

+74
-20
lines changed

Cargo.toml

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,25 @@
11
[package]
22
name = "arithmetic-coding"
3-
description = "fast and felxible arithmetic coding library"
4-
version = "0.1.0"
3+
description = "fast and flexible arithmetic coding library"
4+
version = "0.1.1"
55
edition = "2021"
66
license = "MIT"
77
keywords = ["compression", "encoding", "arithmetic-coding", "lossless"]
88
categories = ["compression", "encoding", "parsing"]
99
repository = "https://github.com/danieleades/arithmetic-coding"
1010

11+
[workspace]
12+
members = [
13+
".",
14+
"arithmetic-coding-core",
15+
"fenwick-model",
16+
]
17+
1118
[dependencies]
19+
arithmetic-coding-core = { path = "./arithmetic-coding-core", version = "0.1.0" }
1220
bitstream-io = "1.2.0"
1321
thiserror = "1.0.30"
1422

1523
[dev-dependencies]
16-
fenwick = { version = "1.0.0" }
1724
test-case = "2.0.0"
25+
fenwick-model = { path = "./fenwick-model" }

arithmetic-coding-core/Cargo.toml

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
[package]
2+
name = "arithmetic-coding-core"
3+
description = "core traits for the 'arithmetic-coding' crate"
4+
version = "0.1.0"
5+
edition = "2021"
6+
license = "MIT"
7+
keywords = ["compression", "encoding", "arithmetic-coding", "lossless"]
8+
categories = ["compression", "encoding", "parsing"]
9+
repository = "https://github.com/danieleades/arithmetic-coding"
10+
11+
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
12+
13+
[dependencies]
14+
thiserror = "1.0.30"
15+

arithmetic-coding-core/README.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
# Arithmetic Coding Core
2+
3+
core traits for the `arithmetic-coding` crate
File renamed without changes.
File renamed without changes.

arithmetic-coding-core/src/lib.rs

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
//! Core traits for the [`arithmetic-coding`](https://github.com/danieleades/arithmetic-coding) crate
2+
3+
#![deny(
4+
missing_docs,
5+
clippy::all,
6+
missing_debug_implementations,
7+
clippy::cargo
8+
)]
9+
#![warn(clippy::pedantic)]
10+
#![feature(int_log)]
11+
#![feature(associated_type_defaults)]
12+
13+
mod bitstore;
14+
pub use bitstore::BitStore;
15+
16+
mod model;
17+
pub use model::Model;
18+
19+
pub mod fixed_length;
File renamed without changes.

examples/fenwick_adaptive.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,8 @@ use std::{fs::File, io::Read, ops::Range};
33
use arithmetic_coding::Model;
44

55
mod common;
6-
mod fenwick;
76

8-
use self::fenwick::simple::{FenwickModel, ValueError};
7+
use fenwick_model::simple::{FenwickModel, ValueError};
98

109
const ALPHABET: &str =
1110
"abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789 .,\n-':()[]#*;\"!?*&é/àâè%@$";

examples/fenwick_context_switching.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,8 @@ use std::{fs::File, io::Read, ops::Range};
33
use arithmetic_coding::Model;
44

55
mod common;
6-
mod fenwick;
76

8-
use self::fenwick::context_switching::{FenwickModel, ValueError};
7+
use fenwick_model::context_switching::{FenwickModel, ValueError};
98

109
const ALPHABET: &str =
1110
"abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789 .,\n-':()[]#*;\"!?*&é/àâè%@$";

fenwick-model/Cargo.toml

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
[package]
2+
name = "fenwick-model"
3+
version = "0.1.0"
4+
edition = "2021"
5+
description = "fenwick-tree-based test utils for the 'arithmetic-coding' crate"
6+
license = "MIT"
7+
keywords = ["compression", "encoding", "arithmetic-coding", "lossless", "fenwick-tree"]
8+
categories = ["compression", "encoding", "parsing"]
9+
repository = "https://github.com/danieleades/arithmetic-coding"
10+
11+
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
12+
13+
[dependencies]
14+
arithmetic-coding-core = { path = "../arithmetic-coding-core" }
15+
fenwick = "1.0.0"
16+
thiserror = "1.0.30"

0 commit comments

Comments
 (0)