Skip to content

Commit 2d762ca

Browse files
committed
release: 0.11.1
2 parents fd8ba06 + d93b1d1 commit 2d762ca

15 files changed

Lines changed: 286 additions & 202 deletions

File tree

.github/workflows/ci.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,12 +21,12 @@ jobs:
2121
matrix:
2222
target:
2323
- x86_64-unknown-linux-gnu
24-
- x86_64-apple-darwin
24+
- aarch64-apple-darwin
2525
- x86_64-pc-windows-msvc
2626
include:
2727
- target: x86_64-unknown-linux-gnu
2828
os: ubuntu-latest
29-
- target: x86_64-apple-darwin
29+
- target: aarch64-apple-darwin
3030
os: macos-latest
3131
- target: x86_64-pc-windows-msvc
3232
os: windows-latest

.github/workflows/msrv.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,11 +21,11 @@ jobs:
2121
matrix:
2222
target:
2323
- x86_64-unknown-linux-gnu
24-
- x86_64-apple-darwin
24+
- aarch64-apple-darwin
2525
include:
2626
- target: x86_64-unknown-linux-gnu
2727
os: ubuntu-latest
28-
- target: x86_64-apple-darwin
28+
- target: aarch64-apple-darwin
2929
os: macos-latest
3030

3131
runs-on: ${{matrix.os}}

CHANGELOG.md

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,19 @@
22

33

44

5+
## [0.11.1](https://github.com/Blobfolio/cdtoc/releases/tag/v0.11.1) - 2025-09-18
6+
7+
### Changed
8+
9+
* Remove `faster-hex` dependency
10+
* Remove `itoa` dependency
11+
* Remove `trimothy` dependency
12+
* Replace `serde` with `serde_core` dependency
13+
* Various minor performance improvements
14+
* Miscellaneous code cleanup and lints
15+
16+
17+
518
## [0.11.0](https://github.com/Blobfolio/cdtoc/releases/tag/v0.11.0) - 2025-06-26
619

720
### Changed

CREDITS.md

Lines changed: 12 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,36 +1,30 @@
11
# Project Dependencies
22
Package: cdtoc
3-
Version: 0.11.0
4-
Generated: 2025-06-26 20:18:46 UTC
3+
Version: 0.11.1
4+
Generated: 2025-09-18 19:41:08 UTC
55

66
| Package | Version | Author(s) | License |
77
| ---- | ---- | ---- | ---- |
8-
| [**dactyl**](https://github.com/Blobfolio/dactyl) | 0.13.0 | [Josh Stoik](mailto:josh@blobfolio.com) | WTFPL |
9-
| [**faster-hex**](https://github.com/NervosFoundation/faster-hex) | 0.10.0 | [zhangsoledad](mailto:787953403@qq.com) | MIT |
10-
| [**trimothy**](https://github.com/Blobfolio/trimothy) | 0.9.0 | [Josh Stoik](mailto:josh@blobfolio.com) | WTFPL |
8+
| [**dactyl**](https://github.com/Blobfolio/dactyl) | 0.13.1 | [Josh Stoik](mailto:josh@blobfolio.com) | WTFPL |
119
| [_block-buffer_](https://github.com/RustCrypto/utils) | 0.10.4 | RustCrypto Developers | MIT OR Apache-2.0 |
12-
| [_byteorder_](https://github.com/BurntSushi/byteorder) | 1.5.0 | [Andrew Gallant](mailto:jamslam@gmail.com) | Unlicense OR MIT |
13-
| [_cc_](https://github.com/rust-lang/cc-rs) ⚒️ | 1.2.27 | [Alex Crichton](mailto:alex@alexcrichton.com) | MIT OR Apache-2.0 |
14-
| [_cfg-if_](https://github.com/rust-lang/cfg-if) | 1.0.1 | [Alex Crichton](mailto:alex@alexcrichton.com) | MIT OR Apache-2.0 |
10+
| [_cc_](https://github.com/rust-lang/cc-rs) ⚒️ | 1.2.37 | [Alex Crichton](mailto:alex@alexcrichton.com) | MIT OR Apache-2.0 |
11+
| [_cfg-if_](https://github.com/rust-lang/cfg-if) | 1.0.3 | [Alex Crichton](mailto:alex@alexcrichton.com) | MIT OR Apache-2.0 |
1512
| [_cpufeatures_](https://github.com/RustCrypto/utils) | 0.2.17 | RustCrypto Developers | MIT OR Apache-2.0 |
1613
| [_crypto-common_](https://github.com/RustCrypto/traits) | 0.1.6 | RustCrypto Developers | MIT OR Apache-2.0 |
1714
| [_digest_](https://github.com/RustCrypto/traits) | 0.10.7 | RustCrypto Developers | MIT OR Apache-2.0 |
15+
| [_find-msvc-tools_](https://github.com/rust-lang/cc-rs) ⚒️ | 0.1.1 | | MIT OR Apache-2.0 |
1816
| [_generic-array_](https://github.com/fizyk20/generic-array.git) | 0.14.7 | [Bartłomiej Kamiński](mailto:fizyk20@gmail.com) and [Aaron Trent](mailto:novacrazy@gmail.com) | MIT |
19-
| [_hash32_](https://github.com/japaric/hash32) | 0.3.1 | [Jorge Aparicio](mailto:jorge@japaric.io) | MIT OR Apache-2.0 |
20-
| [_heapless_](https://github.com/rust-embedded/heapless) | 0.8.0 | [Jorge Aparicio](mailto:jorge@japaric.io), [Per Lindgren](mailto:per.lindgren@ltu.se), and [Emil Fresk](mailto:emil.fresk@gmail.com) | MIT OR Apache-2.0 |
21-
| [**_itoa_**](https://github.com/dtolnay/itoa) | 1.0.15 | [David Tolnay](mailto:dtolnay@gmail.com) | MIT OR Apache-2.0 |
22-
| [_libc_](https://github.com/rust-lang/libc) | 0.2.174 | The Rust Project Developers | MIT OR Apache-2.0 |
23-
| [_proc-macro2_](https://github.com/dtolnay/proc-macro2) ⚒️ | 1.0.95 | [David Tolnay](mailto:dtolnay@gmail.com) and [Alex Crichton](mailto:alex@alexcrichton.com) | MIT OR Apache-2.0 |
17+
| [_libc_](https://github.com/rust-lang/libc) | 0.2.175 | The Rust Project Developers | MIT OR Apache-2.0 |
18+
| [_proc-macro2_](https://github.com/dtolnay/proc-macro2) ⚒️ | 1.0.101 | [David Tolnay](mailto:dtolnay@gmail.com) and [Alex Crichton](mailto:alex@alexcrichton.com) | MIT OR Apache-2.0 |
2419
| [_quote_](https://github.com/dtolnay/quote) ⚒️ | 1.0.40 | [David Tolnay](mailto:dtolnay@gmail.com) | MIT OR Apache-2.0 |
25-
| [**_serde_**](https://github.com/serde-rs/serde) | 1.0.219 | [Erick Tryzelaar](mailto:erick.tryzelaar@gmail.com) and [David Tolnay](mailto:dtolnay@gmail.com) | MIT OR Apache-2.0 |
26-
| [_serde_derive_](https://github.com/serde-rs/serde) | 1.0.219 | [Erick Tryzelaar](mailto:erick.tryzelaar@gmail.com) and [David Tolnay](mailto:dtolnay@gmail.com) | MIT OR Apache-2.0 |
20+
| [**_serde_core_**](https://github.com/serde-rs/serde) | 1.0.225 | [Erick Tryzelaar](mailto:erick.tryzelaar@gmail.com) and [David Tolnay](mailto:dtolnay@gmail.com) | MIT OR Apache-2.0 |
21+
| [_serde_derive_](https://github.com/serde-rs/serde) | 1.0.225 | [Erick Tryzelaar](mailto:erick.tryzelaar@gmail.com) and [David Tolnay](mailto:dtolnay@gmail.com) | MIT OR Apache-2.0 |
2722
| [**_sha1_**](https://github.com/RustCrypto/hashes) | 0.10.6 | RustCrypto Developers | MIT OR Apache-2.0 |
2823
| [_sha1-asm_](https://github.com/RustCrypto/asm-hashes) | 0.5.3 | RustCrypto Developers | MIT |
2924
| [_shlex_](https://github.com/comex/rust-shlex) ⚒️ | 1.3.0 | [comex](mailto:comexk@gmail.com), [Fenhl](mailto:fenhl@fenhl.net), [Adrian Taylor](mailto:adetaylor@chromium.org), [Alex Touchet](mailto:alextouchet@outlook.com), [Daniel Parks](mailto:dp+git@oxidized.org), and [Garrett Berg](mailto:googberg@gmail.com) | MIT OR Apache-2.0 |
30-
| [_stable_deref_trait_](https://github.com/storyyeller/stable_deref_trait) | 1.2.0 | [Robert Grosse](mailto:n210241048576@gmail.com) | MIT OR Apache-2.0 |
31-
| [_syn_](https://github.com/dtolnay/syn) ⚒️ | 2.0.104 | [David Tolnay](mailto:dtolnay@gmail.com) | MIT OR Apache-2.0 |
25+
| [_syn_](https://github.com/dtolnay/syn) ⚒️ | 2.0.106 | [David Tolnay](mailto:dtolnay@gmail.com) | MIT OR Apache-2.0 |
3226
| [_typenum_](https://github.com/paholg/typenum) | 1.18.0 | [Paho Lurie-Gregg](mailto:paho@paholg.com) and [Andre Bogus](mailto:bogusandre@gmail.com) | MIT OR Apache-2.0 |
33-
| [_unicode-ident_](https://github.com/dtolnay/unicode-ident) ⚒️ | 1.0.18 | [David Tolnay](mailto:dtolnay@gmail.com) | (MIT OR Apache-2.0) AND Unicode-3.0 |
27+
| [_unicode-ident_](https://github.com/dtolnay/unicode-ident) ⚒️ | 1.0.19 | [David Tolnay](mailto:dtolnay@gmail.com) | (MIT OR Apache-2.0) AND Unicode-3.0 |
3428
| [_version_check_](https://github.com/SergioBenitez/version_check) ⚒️ | 0.9.5 | [Sergio Benitez](mailto:sb@sergio.bz) | MIT OR Apache-2.0 |
3529

3630
### Legend

Cargo.toml

Lines changed: 5 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "cdtoc"
3-
version = "0.11.0"
3+
version = "0.11.1"
44
authors = ["Josh Stoik <josh@blobfolio.com>"]
55
edition = "2024"
66
rust-version = "1.88"
@@ -32,18 +32,8 @@ serde_json = "1.0.*"
3232

3333
[dependencies]
3434
dactyl = "0.13.*"
35-
trimothy = "0.9.*"
3635

37-
[dependencies.faster-hex]
38-
version = "0.10.*"
39-
default-features = false
40-
features = [ "std" ]
41-
42-
[dependencies.itoa]
43-
version = "1.0.*"
44-
optional = true
45-
46-
[dependencies.serde]
36+
[dependencies.serde_core]
4737
version = "1.0.*"
4838
optional = true
4939

@@ -63,16 +53,16 @@ accuraterip = [ "cddb" ]
6353
asm = [ "sha1/asm" ]
6454

6555
# Enable CDDB ID calculations.
66-
cddb = [ "itoa" ]
56+
cddb = []
6757

6858
# Enable CUETools Database ID calculations.
69-
ctdb = [ "itoa", "sha1" ]
59+
ctdb = [ "sha1" ]
7060

7161
# Enable MusicBrainz ID calculations.
7262
musicbrainz = [ "sha1" ]
7363

7464
# Enable de/serialization support for most types.
75-
serde = [ "dep:serde" ]
65+
serde = [ "dep:serde_core" ]
7666

7767
[[bench]]
7868
name = "accuraterip"

benches/ctdb.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,5 +20,6 @@ fn main() {
2020
inline:
2121
Bench::new("Toc::ctdb_id").run(|| toc.ctdb_id()),
2222
Bench::new("ShaB64::to_string").run(|| ctdb_id.to_string()),
23+
Bench::new("Toc::ctdb_checksum_url").run(|| toc.ctdb_checksum_url()),
2324
);
2425
}

justfile

Lines changed: 8 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -146,38 +146,31 @@ bench BENCH="":
146146
# Get/Set version.
147147
version:
148148
#!/usr/bin/env bash
149+
set -e
149150
150151
# Current version.
151-
_ver1="$( toml get "{{ justfile_directory() }}/Cargo.toml" package.version | \
152-
sed 's/"//g' )"
152+
_ver1="$( tomli query -f "{{ justfile_directory() }}/Cargo.toml" package.version | \
153+
sed 's/[" ]//g' )"
153154
154155
# Find out if we want to bump it.
156+
set +e
155157
_ver2="$( whiptail --inputbox "Set {{ pkg_name }} version:" --title "Release Version" 0 0 "$_ver1" 3>&1 1>&2 2>&3 )"
156158
157159
exitstatus=$?
158160
if [ $exitstatus != 0 ] || [ "$_ver1" = "$_ver2" ]; then
159161
exit 0
160162
fi
161-
162-
fyi success "Setting version to $_ver2."
163+
set -e
163164
164165
# Set the release version!
165-
just _version "{{ justfile_directory() }}" "$_ver2"
166+
tomli set -f "{{ justfile_directory() }}/Cargo.toml" -i package.version "$_ver2"
167+
168+
fyi success "Set version to $_ver2."
166169
167170
# Update the credits.
168171
just credits
169172
170173
171-
# Set version for real.
172-
@_version DIR VER:
173-
[ -f "{{ DIR }}/Cargo.toml" ] || exit 1
174-
175-
# Set the release version!
176-
toml set "{{ DIR }}/Cargo.toml" package.version "{{ VER }}" > /tmp/Cargo.toml
177-
just _fix-chown "/tmp/Cargo.toml"
178-
mv "/tmp/Cargo.toml" "{{ DIR }}/Cargo.toml"
179-
180-
181174
# Fix file/directory permissions.
182175
@_fix-chmod PATH:
183176
[ ! -e "{{ PATH }}" ] || find "{{ PATH }}" -type f -exec chmod 0644 {} +

src/accuraterip.rs

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44

55
use crate::{
66
Cddb,
7+
hex,
78
Toc,
89
TocError,
910
};
@@ -424,9 +425,20 @@ impl AccurateRip {
424425
disc_id[..3].copy_from_slice(dactyl::NiceU8::from(self.0[0]).as_bytes3());
425426

426427
// ID Parts.
427-
faster_hex::hex_encode_fallback(&[self.0[4], self.0[3], self.0[2], self.0[1]], &mut disc_id[4..12]);
428-
faster_hex::hex_encode_fallback(&[self.0[8], self.0[7], self.0[6], self.0[5]], &mut disc_id[13..21]);
429-
faster_hex::hex_encode_fallback(&[self.0[12], self.0[11], self.0[10], self.0[9]], &mut disc_id[22..]);
428+
[disc_id[4], disc_id[5]] = hex::lower_encode_u8(self.0[4]);
429+
[disc_id[6], disc_id[7]] = hex::lower_encode_u8(self.0[3]);
430+
[disc_id[8], disc_id[9]] = hex::lower_encode_u8(self.0[2]);
431+
[disc_id[10], disc_id[11]] = hex::lower_encode_u8(self.0[1]);
432+
433+
[disc_id[13], disc_id[14]] = hex::lower_encode_u8(self.0[8]);
434+
[disc_id[15], disc_id[16]] = hex::lower_encode_u8(self.0[7]);
435+
[disc_id[17], disc_id[18]] = hex::lower_encode_u8(self.0[6]);
436+
[disc_id[19], disc_id[20]] = hex::lower_encode_u8(self.0[5]);
437+
438+
[disc_id[22], disc_id[23]] = hex::lower_encode_u8(self.0[12]);
439+
[disc_id[24], disc_id[25]] = hex::lower_encode_u8(self.0[11]);
440+
[disc_id[26], disc_id[27]] = hex::lower_encode_u8(self.0[10]);
441+
[disc_id[28], disc_id[29]] = hex::lower_encode_u8(self.0[9]);
430442

431443
disc_id
432444
}

src/cddb.rs

Lines changed: 21 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
*/
44

55
use crate::{
6+
hex,
67
Toc,
78
TocError,
89
};
@@ -49,9 +50,8 @@ impl Eq for Cddb {}
4950

5051
impl fmt::Display for Cddb {
5152
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
52-
let mut buf = [b'0'; 8];
53-
faster_hex::hex_encode_fallback(self.0.to_be_bytes().as_slice(), &mut buf);
54-
std::str::from_utf8(buf.as_slice())
53+
let out = hex::lower_encode_u32(self.0);
54+
std::str::from_utf8(out.as_slice())
5555
.map_err(|_| fmt::Error)
5656
.and_then(|s| <str as fmt::Display>::fmt(s, f))
5757
}
@@ -81,23 +81,29 @@ impl From<Cddb> for u32 {
8181
impl From<&Toc> for Cddb {
8282
#[expect(clippy::cast_possible_truncation, reason = "False positive.")]
8383
fn from(src: &Toc) -> Self {
84-
let mut len = src.audio_len();
85-
let mut a: u32 = 0;
86-
87-
// Add the audio positions.
88-
let mut buf = itoa::Buffer::new();
89-
for v in src.audio_sectors() {
90-
for b in buf.format(v.wrapping_div(75)).bytes() {
91-
a += u32::from(b ^ b'0');
84+
/// # Sum Digits.
85+
///
86+
/// Add up each individual digit of `num`, returning the total.
87+
const fn sum_digits(mut num: u32) -> u32 {
88+
let mut total = 0;
89+
while 9 < num {
90+
total += num % 10;
91+
num /= 10;
9292
}
93+
total + num
9394
}
9495

95-
// Add the data position.
96+
let mut len = src.audio_len();
97+
98+
// Add up all the digits of all the audio sectors.
99+
let mut a: u32 = src.audio_sectors()
100+
.iter()
101+
.fold(0, |a, b| a + sum_digits(b.wrapping_div(75)));
102+
103+
// Add the data position, if any.
96104
if let Some(v) = src.data_sector() {
97105
len += 1;
98-
for b in buf.format(v.wrapping_div(75)).bytes() {
99-
a += u32::from(b ^ b'0');
100-
}
106+
a += sum_digits(v.wrapping_div(75));
101107
}
102108

103109
// The three parts we need.

0 commit comments

Comments
 (0)