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:
+1
-1
@@ -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
@@ -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);
|
||||||
|
|||||||
Reference in New Issue
Block a user