commit 451d988ac338a68d3448a3762c43471a2666da3e
parent 7bd219808ca7000bd41d8ae3ac83b4902cc9cf1a
Author: Zack Newman <zack@philomathiclife.com>
Date: Sun, 11 Feb 2024 10:13:12 -0700
update ascii_domain dep
Diffstat:
3 files changed, 7 insertions(+), 4 deletions(-)
diff --git a/Cargo.toml b/Cargo.toml
@@ -9,7 +9,7 @@ license = "MIT OR Apache-2.0"
name = "rpz"
readme = "README.md"
repository = "https://git.philomathiclife.com/repos/rpz/"
-version = "0.4.0"
+version = "0.5.0"
[lib]
name = "rpz"
@@ -20,7 +20,7 @@ name = "rpz"
path = "src/main.rs"
[dependencies]
-ascii_domain = { version = "0.4.0", default-features = false }
+ascii_domain = { version = "0.5.0", default-features = false }
num-bigint = { version = "0.4.4", default-features = false }
reqwest = { version = "0.11.24", default-features = false, features = ["brotli", "deflate", "gzip", "rustls-tls-native-roots", "trust-dns"] }
serde = { version = "1.0.196", default-features = false }
diff --git a/src/dom.rs b/src/dom.rs
@@ -71,7 +71,10 @@ fn domain_no_ip<'a: 'b, 'b>(val: &'a [u8]) -> Result<Domain<&'b str>, FirefoxDom
.try_fold(0u8, |count, label| {
// If there are more than 4 `Label`s, it's not an IPv4 address. Similarly if there is more
// than 3 characters in the the `Label`, then it's not a valid IPv4 octet.
- if count < 4 && label.len() < 4 && label.as_str().parse::<u8>().is_ok() {
+ if count < 4
+ && label.len().get() < 4
+ && label.as_str().parse::<u8>().is_ok()
+ {
Ok(count + 1)
} else {
Err(())
diff --git a/src/dom_count_auto_gen.rs b/src/dom_count_auto_gen.rs
@@ -36,7 +36,7 @@ pub fn proper_subdomain_count(dom: &Domain<&str>) -> BigUint {
//
// Note that `Label`s always have a length of at least 1 and any `Label` longer than 3
// cannot be a valid octet in an IPv4 address.
- if count < 4 && label.len() < 4 && label.as_str().parse::<u8>().is_ok() {
+ if count < 4 && label.len().get() < 4 && label.as_str().parse::<u8>().is_ok() {
Ok(count + 1)
} else {
Err(())