rpz

Response policy zone (RPZ) file generator.
git clone https://git.philomathiclife.com/repos/rpz
Log | Files | Refs | README

commit dfb262c51c0da9c3c7ab6ae8309a47e74eaaaee4
parent 1966f57cd8c5687006856ddfb6089c6befee0a0d
Author: Zack Newman <zack@philomathiclife.com>
Date:   Mon, 13 Jul 2026 14:55:23 -0600

update deps. new lints

Diffstat:
MCargo.toml | 20++++++++++----------
Msrc/lib.rs | 1+
Msrc/tests.rs | 110+++++++++++++++++++++++++++++++++++++------------------------------------------
3 files changed, 63 insertions(+), 68 deletions(-)

diff --git a/Cargo.toml b/Cargo.toml @@ -27,14 +27,14 @@ unused = { level = "deny", priority = -1 } warnings = { level = "deny", priority = -1 } ambiguous-negative-literals = { level = "deny", priority = -1 } closure-returning-async-block = { level = "deny", priority = -1 } +dead-code-pub-in-binary = { level = "deny", priority = -1 } deprecated-in-future = { level = "deny", priority = -1 } +#deprecated-llvm-intrinsic = { level = "deny", priority = -1 } deref-into-dyn-supertrait = { level = "deny", priority = -1 } ffi-unwind-calls = { level = "deny", priority = -1 } -#fuzzy-provenance-casts = { level = "deny", priority = -1 } impl-trait-redundant-captures = { level = "deny", priority = -1 } +#implicit-provenance-casts = { level = "deny", priority = -1 } linker-info = { level = "deny", priority = -1 } -linker-messages = { level = "deny", priority = -1 } -#lossy-provenance-casts = { level = "deny", priority = -1 } macro-use-extern-crate = { level = "deny", priority = -1 } meta-variable-misuse = { level = "deny", priority = -1 } missing-copy-implementations = { level = "deny", priority = -1 } @@ -76,7 +76,6 @@ variant-size-differences = { level = "deny", priority = -1 } #dependency-on-unit-never-type-fallback = { level = "allow", priority = -1 } #deref-nullptr = { level = "allow", priority = -1 } #duplicate-features = { level = "allow", priority = -1 } -#elided-lifetimes-in-associated-constant = { level = "allow", priority = -1 } #enum-intrinsics-non-enums = { level = "allow", priority = -1 } #explicit-builtin-cfgs-in-flags = { level = "allow", priority = -1 } #ill-formed-attribute-input = { level = "allow", priority = -1 } @@ -87,6 +86,7 @@ variant-size-differences = { level = "deny", priority = -1 } #invalid-macro-export-arguments = { level = "allow", priority = -1 } #invalid-null-arguments = { level = "allow", priority = -1 } #invalid-reference-casting = { level = "allow", priority = -1 } +#invalid-runtime-symbol-definitions = { level = "allow", priority = -1 } #invalid-type-param-default = { level = "allow", priority = -1 } #legacy-derive-helpers = { level = "allow", priority = -1 } #let-underscore-lock = { level = "allow", priority = -1 } @@ -101,7 +101,6 @@ variant-size-differences = { level = "deny", priority = -1 } #patterns-in-fns-without-body = { level = "allow", priority = -1 } #proc-macro-derive-resolution-fallback = { level = "allow", priority = -1 } #pub-use-of-private-extern-crate = { level = "allow", priority = -1 } -#repr-transparent-non-zst-fields = { level = "allow", priority = -1 } #semicolon-in-expressions-from-macros = { level = "allow", priority = -1 } #test-unstable-lint = { level = "allow", priority = -1 } #text-direction-codepoint-in-comment = { level = "allow", priority = -1 } @@ -111,6 +110,7 @@ variant-size-differences = { level = "deny", priority = -1 } #uninhabited-static = { level = "allow", priority = -1 } #unknown-crate-types = { level = "allow", priority = -1 } #useless-deprecated = { level = "allow", priority = -1 } +#varargs-without-pattern = { level = "allow", priority = -1 } [lints.clippy] cargo = { level = "deny", priority = -1 } @@ -172,14 +172,14 @@ targets = [ ] [dependencies] -ascii_domain = { version = "0.6.9", default-features = false } -num-bigint = { version = "0.4.6", default-features = false } +ascii_domain = { version = "0.6.10", default-features = false } +num-bigint = { version = "0.5.1", default-features = false } serde = { version = "1.0.228", default-features = false } -superset_map = { version = "0.3.6", default-features = false } +superset_map = { version = "0.3.7", default-features = false } tokio = { version = "1.52.3", default-features = false, features = ["rt", "time"] } toml = { version = "1.1.2", default-features = false, features = ["parse", "serde"] } url = { version = "2.5.8", default-features = false, features = ["serde"] } -zfc = { version = "0.4.7", default-features = false } +zfc = { version = "0.5.0", default-features = false } [target.'cfg(not(target_os = "openbsd"))'.dependencies] reqwest = { version = "0.13.4", default-features = false, features = ["brotli", "deflate", "gzip", "http2", "rustls"] } @@ -187,7 +187,7 @@ reqwest = { version = "0.13.4", default-features = false, features = ["brotli", [target.'cfg(target_os = "openbsd")'.dependencies] priv_sep = { version = "3.0.0-alpha.5.1", default-features = false, features = ["std"] } reqwest = { version = "0.13.4", default-features = false, features = ["brotli", "deflate", "gzip", "http2", "rustls-no-provider"] } -rustls = { version = "0.23.40", default-features = false, features = ["ring"] } +rustls = { version = "0.23.42", default-features = false, features = ["ring"] } [profile.release] codegen-units = 1 diff --git a/src/lib.rs b/src/lib.rs @@ -27,6 +27,7 @@ unstable_features, reason = "the only reason we require nightly is for the below features" )] +#![cfg_attr(test, expect(dead_code_pub_in_binary, reason = "ignore for tests"))] #![feature(core_io, io_error_more)] /// Module for hostname-like domains including parsing [`str`]s /// from a variety of formats. diff --git a/src/tests.rs b/src/tests.rs @@ -16,65 +16,59 @@ pub(crate) const ERR_MSG: &str = " does not exist, so program testing cannot occ /// Verify the correct directories and files exist. #[expect(clippy::panic, reason = "OK in tests")] pub(crate) fn verify_files() { - if !fs::metadata(PROG) - .unwrap_or_else(|_| panic!("{PROG}{ERR_MSG}")) - .is_file() - { - panic!("{PROG} is not an executable file") - } else if !fs::metadata(PROG_DIR) - .unwrap_or_else(|_| panic!("{PROG_DIR}{ERR_MSG}")) - .is_dir() - { - panic!("{PROG_DIR} is not a directory") - } else if !fs::metadata(PROG_DIR_NO_SUB) - .unwrap_or_else(|_| panic!("{PROG_DIR_NO_SUB}{ERR_MSG}")) - .is_dir() - { - panic!("{PROG_DIR_NO_SUB} is not a directory") - } else { - let mut files = String::from(PROG_DIR); - let len = files.len(); - files.push_str("block/adblock/foo"); - if fs::metadata(files.as_str()) + assert!( + fs::metadata(PROG) + .unwrap_or_else(|_| panic!("{PROG}{ERR_MSG}")) + .is_file(), + "{PROG} is not an executable file" + ); + assert!( + fs::metadata(PROG_DIR) + .unwrap_or_else(|_| panic!("{PROG_DIR}{ERR_MSG}")) + .is_dir(), + "{PROG_DIR} is not a directory" + ); + assert!( + fs::metadata(PROG_DIR_NO_SUB) + .unwrap_or_else(|_| panic!("{PROG_DIR_NO_SUB}{ERR_MSG}")) + .is_dir(), + "{PROG_DIR_NO_SUB} is not a directory" + ); + let mut files = String::from(PROG_DIR); + let len = files.len(); + files.push_str("block/adblock/foo"); + assert!( + fs::metadata(files.as_str()) .unwrap_or_else(|_| panic!("{files}{ERR_MSG}. it must only contain '||bar.com'")) - .is_file() - { - files.truncate(len); - files.push_str("block/domain/foo"); - if fs::metadata(files.as_str()) - .unwrap_or_else(|_| { - panic!("{files}{ERR_MSG}. it must only contain 'www.example.com'") - }) - .is_file() - { - files.truncate(len); - files.push_str("unblock/hosts/foo"); - if fs::metadata(files.as_str()) - .unwrap_or_else(|_| { - panic!("{files}{ERR_MSG}. it must only contain '0.0.0.0 www.bar.com'") - }) - .is_file() - { - files.truncate(len); - files.push_str("unblock/wildcard/foo"); - if !fs::metadata(files.as_str()) - .unwrap_or_else(|_| { - panic!("{files}{ERR_MSG}. it must only contain '*.foo.com'") - }) - .is_file() - { - panic!("{files} is not a file"); - } - } else { - panic!("{files} is not a file"); - } - } else { - panic!("{files} is not a file"); - } - } else { - panic!("{files} is not a file"); - } - } + .is_file(), + "{files} is not a file" + ); + files.truncate(len); + files.push_str("block/domain/foo"); + assert!( + fs::metadata(files.as_str()) + .unwrap_or_else(|_| panic!("{files}{ERR_MSG}. it must only contain 'www.example.com'")) + .is_file(), + "{files} is not a file" + ); + files.truncate(len); + files.push_str("unblock/hosts/foo"); + assert!( + fs::metadata(files.as_str()) + .unwrap_or_else(|_| panic!( + "{files}{ERR_MSG}. it must only contain '0.0.0.0 www.bar.com'" + )) + .is_file(), + "{files} is not a file" + ); + files.truncate(len); + files.push_str("unblock/wildcard/foo"); + assert!( + fs::metadata(files.as_str()) + .unwrap_or_else(|_| panic!("{files}{ERR_MSG}. it must only contain '*.foo.com'")) + .is_file(), + "{files} is not a file" + ); } pub(crate) fn get_command() -> Command { Command::new(PROG)