Fix is_multiple_of nightly API, bump to 0.8.3

Replace s.len().is_multiple_of(2) with s.len() % 2 != 0 for stable Rust.
This was fixed previously but regressed.
This commit is contained in:
MattJackson
2026-04-13 00:31:54 +00:00
parent 45e0bff182
commit fc86491557
2 changed files with 2 additions and 2 deletions
+1 -1
View File
@@ -1,6 +1,6 @@
[package] [package]
name = "libfreemkv" name = "libfreemkv"
version = "0.8.2" version = "0.8.3"
edition = "2021" edition = "2021"
license = "AGPL-3.0-only" license = "AGPL-3.0-only"
description = "Open source raw disc access library for optical drives" description = "Open source raw disc access library for optical drives"
+1 -1
View File
@@ -57,7 +57,7 @@ pub struct DiscEntry {
/// Parse a hex string like "0xABCD..." into bytes. /// Parse a hex string like "0xABCD..." into bytes.
pub(crate) fn parse_hex(s: &str) -> Option<Vec<u8>> { pub(crate) fn parse_hex(s: &str) -> Option<Vec<u8>> {
let s = s.trim().trim_start_matches("0x").trim_start_matches("0X"); let s = s.trim().trim_start_matches("0x").trim_start_matches("0X");
if !s.len().is_multiple_of(2) { if s.len() % 2 != 0 {
return None; return None;
} }
let mut out = Vec::with_capacity(s.len() / 2); let mut out = Vec::with_capacity(s.len() / 2);