From 880dc6e600249461e4480931152c7c9dcdb5dfea Mon Sep 17 00:00:00 2001 From: "daniel.eades" Date: Fri, 17 Jan 2025 13:41:23 +0000 Subject: [PATCH 1/4] update to 2024 edition --- Cargo.toml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index 1178067..51715d2 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -2,8 +2,8 @@ members = [".", "arithmetic-coding-core", "fenwick-model"] [workspace.package] -rust-version = "1.83.0" -edition = "2021" +rust-version = "1.85.0" +edition = "2024" license = "MIT" keywords = ["compression", "encoding", "arithmetic-coding", "lossless"] categories = ["compression", "encoding", "parsing"] From f348e731289938baea02153d569f1cafa89fdc23 Mon Sep 17 00:00:00 2001 From: "daniel.eades" Date: Fri, 31 Jan 2025 08:49:43 +0000 Subject: [PATCH 2/4] fixup --- Cargo.lock | 96 ++++++++++---------- arithmetic-coding-core/src/lib.rs | 2 +- arithmetic-coding-core/src/model/one_shot.rs | 2 +- benches/sherlock.rs | 4 +- examples/fenwick_adaptive.rs | 2 +- examples/fenwick_context_switching.rs | 2 +- src/decoder.rs | 2 +- src/encoder.rs | 2 +- src/lib.rs | 2 +- tests/precision_checking.rs | 2 +- 10 files changed, 58 insertions(+), 58 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 02e0356..9ad72fe 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -19,9 +19,9 @@ checksum = "4b46cbb362ab8752921c97e041f5e366ee6297bd428a31275b9fcf1e380f7299" [[package]] name = "anstyle" -version = "1.0.10" +version = "1.0.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "55cc3b69f167a1ef2e161439aa98aed94e6028e5f9a59be9a6ffb47aef1651f9" +checksum = "862ed96ca487e809f1c8e5a8447f6ee2cf102f846893800b20cebdf541fc6bbd" [[package]] name = "arithmetic-coding" @@ -44,9 +44,9 @@ dependencies = [ [[package]] name = "autocfg" -version = "1.4.0" +version = "1.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ace50bade8e6234aa140d9a2f552bbee1db4d353f69b8217bc503490fc1a9f26" +checksum = "c08606f8c3cbf4ce6ec8e28fb0014a2c086708fe954eaa885384a6165172e7e8" [[package]] name = "bitstream-io" @@ -59,9 +59,9 @@ dependencies = [ [[package]] name = "bumpalo" -version = "3.16.0" +version = "3.19.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "79296716171880943b8470b5f8d03aa55eb2e645a4874bdbb28adb49162e012c" +checksum = "46c5e41b57b8bba42a04676d81cb89e9ee8e859a1a66f80a5a72e1cb76b34d43" [[package]] name = "cast" @@ -71,9 +71,9 @@ checksum = "37b2a672a2cb129a2e41c10b1224bb368f9f37a2b16b612598138befd7b37eb5" [[package]] name = "cfg-if" -version = "1.0.0" +version = "1.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" +checksum = "9555578bc9e57714c812a1f84e4fc5b4d21fcb063490c624de019f7464c91268" [[package]] name = "ciborium" @@ -104,18 +104,18 @@ dependencies = [ [[package]] name = "clap" -version = "4.5.26" +version = "4.5.41" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a8eb5e908ef3a6efbe1ed62520fb7287959888c88485abe072543190ecc66783" +checksum = "be92d32e80243a54711e5d7ce823c35c41c9d929dc4ab58e1276f625841aadf9" dependencies = [ "clap_builder", ] [[package]] name = "clap_builder" -version = "4.5.26" +version = "4.5.41" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "96b01801b5fc6a0a232407abc821660c9c6d25a1cafc0d4f85f29fb8d9afc121" +checksum = "707eab41e9622f9139419d573eca0900137718000c517d47da73045f54331c3d" dependencies = [ "anstyle", "clap_lex", @@ -123,9 +123,9 @@ dependencies = [ [[package]] name = "clap_lex" -version = "0.7.4" +version = "0.7.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f46ad14479a25103f283c0f10005961cf086d8dc42205bb44c46ac563475dca6" +checksum = "b94f61472cee1439c0b966b47e3aca9ae07e45d070759512cd390ea2bebc6675" [[package]] name = "core2" @@ -196,15 +196,15 @@ checksum = "d0a5c400df2834b80a4c3327b3aad3a4c4cd4de0629063962b03235697506a28" [[package]] name = "crunchy" -version = "0.2.2" +version = "0.2.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7a81dae078cea95a014a339291cec439d2f232ebe854a9d672b796c6afafa9b7" +checksum = "460fbee9c2c2f33933d720630a6a0bac33ba7053db5344fac858d4b8952d77d5" [[package]] name = "either" -version = "1.13.0" +version = "1.15.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "60b1af1c220855b6ceac025d3f6ecdd2b7c4894bfe9cd9bda4fbb4bc7c0d4cf0" +checksum = "48c757948c5ede0e46177b7add2e67155f70e33c07fea8284df6576da70b3719" [[package]] name = "fenwick" @@ -223,9 +223,9 @@ dependencies = [ [[package]] name = "half" -version = "2.4.1" +version = "2.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6dd08c532ae367adf81c312a4580bc67f1d0fe8bc9c460520283f4c0ff277888" +checksum = "459196ed295495a68f7d7fe1d84f6c4b7ff0e21fe3017b2f283c6fac3ad803c9" dependencies = [ "cfg-if", "crunchy", @@ -251,9 +251,9 @@ dependencies = [ [[package]] name = "itoa" -version = "1.0.14" +version = "1.0.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d75a2a4b1b190afb6f5425f10f6a8f959d2ea0b9c2b1d79553551850539e4674" +checksum = "4a5f13b858c8d314ee3e8f639011f7ccefe71f97f96e50151fb991f267928e2c" [[package]] name = "js-sys" @@ -267,15 +267,15 @@ dependencies = [ [[package]] name = "log" -version = "0.4.25" +version = "0.4.27" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "04cbf5b083de1c7e0222a7a51dbfdba1cbe1c6ab0b15e29fff3f6c077fd9cd9f" +checksum = "13dc2df351e3202783a1fe0d44375f7295ffb4049267b0f3018346dc122a1d94" [[package]] name = "memchr" -version = "2.7.4" +version = "2.7.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "78ca9ab1a0babb1e7d5695e3530886289c18cf2f87ec19a575a0abdce112e3a3" +checksum = "32a282da65faaf38286cf3be983213fcf1d2e2a58700e808f83f4ea9a4804bc0" [[package]] name = "num-traits" @@ -288,15 +288,15 @@ dependencies = [ [[package]] name = "once_cell" -version = "1.20.2" +version = "1.21.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1261fe7e33c73b354eab43b1273a57c8f967d0391e80353e51f764ac02cf6775" +checksum = "42f5e15c9953c5e4ccceeb2e7382a716482c34515315f7b03532b8b4e8393d2d" [[package]] name = "oorandom" -version = "11.1.4" +version = "11.1.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b410bbe7e14ab526a0e86877eb47c6996a2bd7746f027ba551028c925390e4e9" +checksum = "d6790f58c7ff633d8771f42965289203411a5e5c68388703c06e14f24770b41e" [[package]] name = "plotters" @@ -328,18 +328,18 @@ dependencies = [ [[package]] name = "proc-macro2" -version = "1.0.93" +version = "1.0.95" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "60946a68e5f9d28b0dc1c21bb8a97ee7d018a8b322fa57838ba31cc878e22d99" +checksum = "02b3e5e68a3a1a02aad3ec490a98007cbc13c37cbe84a3cd7b8e406d76e7f778" dependencies = [ "unicode-ident", ] [[package]] name = "quote" -version = "1.0.38" +version = "1.0.40" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0e4dccaaaf89514f546c693ddc140f729f958c247918a13380cccc6078391acc" +checksum = "1885c039570dc00dcb4ff087a89e185fd56bae234ddc7f056a945bf36467248d" dependencies = [ "proc-macro2", ] @@ -395,15 +395,15 @@ checksum = "2b15c43186be67a4fd63bee50d0303afffcef381492ebe2c5d87f324e1b8815c" [[package]] name = "rustversion" -version = "1.0.19" +version = "1.0.21" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f7c45b9784283f1b2e7fb61b42047c2fd678ef0960d4f6f1eba131594cc369d4" +checksum = "8a0d197bd2c9dc6e53b84da9556a69ba4cdfab8619eb41a8bd1cc2027a0f6b1d" [[package]] name = "ryu" -version = "1.0.18" +version = "1.0.20" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f3cb5ba0dc43242ce17de99c180e96db90b235b8a9fdc9543c96d2209116bd9f" +checksum = "28d3b2b1366ec20994f1fd18c3c594f05c5dd4bc44d8bb0c1c632c8d6829481f" [[package]] name = "same-file" @@ -416,18 +416,18 @@ dependencies = [ [[package]] name = "serde" -version = "1.0.217" +version = "1.0.219" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "02fc4265df13d6fa1d00ecff087228cc0a2b5f3c0e87e258d8b94a156e984c70" +checksum = "5f0e2c6ed6606019b4e29e69dbaba95b11854410e5347d525002456dbbb786b6" dependencies = [ "serde_derive", ] [[package]] name = "serde_derive" -version = "1.0.217" +version = "1.0.219" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5a9bf7cf98d04a2b28aead066b7496853d4779c9cc183c440dbac457641e19a0" +checksum = "5b0276cf7f2c73365f7157c8123c21cd9a50fbbd844757af28ca1f5925fc2a00" dependencies = [ "proc-macro2", "quote", @@ -436,9 +436,9 @@ dependencies = [ [[package]] name = "serde_json" -version = "1.0.135" +version = "1.0.141" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2b0d7ba2887406110130a978386c4e1befb98c674b4fba677954e4db976630d9" +checksum = "30b9eff21ebe718216c6ec64e1d9ac57087aad11efc64e32002bce4a0d4c03d3" dependencies = [ "itoa", "memchr", @@ -448,9 +448,9 @@ dependencies = [ [[package]] name = "syn" -version = "2.0.96" +version = "2.0.104" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d5d0adab1ae378d7f53bdebc67a39f1f151407ef230f0ce2883572f5d8985c80" +checksum = "17b6f705963418cdb9927482fa304bc562ece2fdd4f616084c50b7023b435a40" dependencies = [ "proc-macro2", "quote", @@ -522,9 +522,9 @@ dependencies = [ [[package]] name = "unicode-ident" -version = "1.0.14" +version = "1.0.18" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "adb9e6ca4f869e1180728b7950e35922a7fc6397f7b641499e8f3ef06e50dc83" +checksum = "5a5f39404a5da50712a4c1eecf25e90dd62b613502b7e925fd4e4d19b5c96512" [[package]] name = "walkdir" diff --git a/arithmetic-coding-core/src/lib.rs b/arithmetic-coding-core/src/lib.rs index 88a296d..a5363e6 100644 --- a/arithmetic-coding-core/src/lib.rs +++ b/arithmetic-coding-core/src/lib.rs @@ -6,4 +6,4 @@ mod bitstore; pub use bitstore::BitStore; mod model; -pub use model::{fixed_length, max_length, one_shot, Model}; +pub use model::{Model, fixed_length, max_length, one_shot}; diff --git a/arithmetic-coding-core/src/model/one_shot.rs b/arithmetic-coding-core/src/model/one_shot.rs index 1c667a9..13f849b 100644 --- a/arithmetic-coding-core/src/model/one_shot.rs +++ b/arithmetic-coding-core/src/model/one_shot.rs @@ -3,7 +3,7 @@ use std::ops::Range; pub use crate::fixed_length::Wrapper; -use crate::{fixed_length, BitStore}; +use crate::{BitStore, fixed_length}; /// A [`Model`] is used to calculate the probability of a given symbol occurring /// in a sequence. diff --git a/benches/sherlock.rs b/benches/sherlock.rs index 6e06831..c517cf9 100644 --- a/benches/sherlock.rs +++ b/benches/sherlock.rs @@ -1,7 +1,7 @@ use std::{fs::File, io::Read, ops::Range}; use arithmetic_coding::Model; -use fenwick_model::{simple::FenwickModel, ValueError}; +use fenwick_model::{ValueError, simple::FenwickModel}; mod common; @@ -58,7 +58,7 @@ fn round_trip(input: &[u8]) { common::round_trip(model, input); } -use criterion::{black_box, criterion_group, criterion_main, Criterion}; +use criterion::{Criterion, black_box, criterion_group, criterion_main}; #[allow(clippy::missing_panics_doc)] pub fn criterion_benchmark(c: &mut Criterion) { diff --git a/examples/fenwick_adaptive.rs b/examples/fenwick_adaptive.rs index f7d33da..800dcb7 100644 --- a/examples/fenwick_adaptive.rs +++ b/examples/fenwick_adaptive.rs @@ -4,7 +4,7 @@ use arithmetic_coding::Model; mod common; -use fenwick_model::{simple::FenwickModel, ValueError}; +use fenwick_model::{ValueError, simple::FenwickModel}; const ALPHABET: &str = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789 .,\n-':()[]#*;\"!?*&é/àâè%@$"; diff --git a/examples/fenwick_context_switching.rs b/examples/fenwick_context_switching.rs index 77a1ffc..1d3fc1f 100644 --- a/examples/fenwick_context_switching.rs +++ b/examples/fenwick_context_switching.rs @@ -4,7 +4,7 @@ use arithmetic_coding::Model; mod common; -use fenwick_model::{context_switching::FenwickModel, ValueError}; +use fenwick_model::{ValueError, context_switching::FenwickModel}; const ALPHABET: &str = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789 .,\n-':()[]#*;\"!?*&é/àâè%@$"; diff --git a/src/decoder.rs b/src/decoder.rs index 46f8dd9..33daca3 100644 --- a/src/decoder.rs +++ b/src/decoder.rs @@ -5,8 +5,8 @@ use std::{io, ops::Range}; use bitstream_io::BitRead; use crate::{ - common::{self, assert_precision_sufficient}, BitStore, Model, + common::{self, assert_precision_sufficient}, }; // this algorithm is derived from this article - https://marknelson.us/posts/2014/10/19/data-compression-with-arithmetic-coding.html diff --git a/src/encoder.rs b/src/encoder.rs index 8594407..023078c 100644 --- a/src/encoder.rs +++ b/src/encoder.rs @@ -5,8 +5,8 @@ use std::{io, ops::Range}; use bitstream_io::BitWrite; use crate::{ - common::{self, assert_precision_sufficient}, BitStore, Error, Model, + common::{self, assert_precision_sufficient}, }; // this algorithm is derived from this article - https://marknelson.us/posts/2014/10/19/data-compression-with-arithmetic-coding.html diff --git a/src/lib.rs b/src/lib.rs index 4c92037..d41b513 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -6,7 +6,7 @@ missing_copy_implementations )] -pub use arithmetic_coding_core::{fixed_length, max_length, one_shot, BitStore, Model}; +pub use arithmetic_coding_core::{BitStore, Model, fixed_length, max_length, one_shot}; mod common; pub mod decoder; diff --git a/tests/precision_checking.rs b/tests/precision_checking.rs index 25eaabe..f7627e3 100644 --- a/tests/precision_checking.rs +++ b/tests/precision_checking.rs @@ -4,7 +4,7 @@ use std::{convert::Infallible, io::Cursor, ops::Range}; -use arithmetic_coding::{decoder, encoder, Decoder, Encoder}; +use arithmetic_coding::{Decoder, Encoder, decoder, encoder}; use arithmetic_coding_core::one_shot; use bitstream_io::{BigEndian, BitReader, BitWriter}; From 4e10da2b0be64fa1d97d4a008f23ab7377f898a2 Mon Sep 17 00:00:00 2001 From: "daniel.eades" Date: Fri, 31 Jan 2025 08:52:30 +0000 Subject: [PATCH 3/4] fixup --- .vscode/settings.json | 6 ++++++ 1 file changed, 6 insertions(+) create mode 100644 .vscode/settings.json diff --git a/.vscode/settings.json b/.vscode/settings.json new file mode 100644 index 0000000..3eeaa80 --- /dev/null +++ b/.vscode/settings.json @@ -0,0 +1,6 @@ +{ + "cSpell.words": [ + "clippy", + "thiserror" + ] +} \ No newline at end of file From d991c3454bedfce957ba83573af9478fe9539e4e Mon Sep 17 00:00:00 2001 From: "daniel.eades" Date: Fri, 31 Jan 2025 08:53:15 +0000 Subject: [PATCH 4/4] fixup --- .vscode/settings.json | 6 ------ 1 file changed, 6 deletions(-) delete mode 100644 .vscode/settings.json diff --git a/.vscode/settings.json b/.vscode/settings.json deleted file mode 100644 index 3eeaa80..0000000 --- a/.vscode/settings.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "cSpell.words": [ - "clippy", - "thiserror" - ] -} \ No newline at end of file