update to phf 0.12

This commit is contained in:
GyulyVGC
2025-06-25 23:14:44 +02:00
parent 3f019aac44
commit 176991c994
2 changed files with 43 additions and 13 deletions

51
Cargo.lock generated
View File

@@ -3483,7 +3483,7 @@ dependencies = [
"approx", "approx",
"fast-srgb8", "fast-srgb8",
"palette_derive", "palette_derive",
"phf", "phf 0.11.3",
] ]
[[package]] [[package]]
@@ -3586,17 +3586,27 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "1fd6780a80ae0c52cc120a26a1a42c1ae51b247a253e4e06113d23d2c2edd078" checksum = "1fd6780a80ae0c52cc120a26a1a42c1ae51b247a253e4e06113d23d2c2edd078"
dependencies = [ dependencies = [
"phf_macros", "phf_macros",
"phf_shared", "phf_shared 0.11.3",
]
[[package]]
name = "phf"
version = "0.12.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "913273894cec178f401a31ec4b656318d95473527be05c0752cc41cdc32be8b7"
dependencies = [
"phf_shared 0.12.1",
"serde",
] ]
[[package]] [[package]]
name = "phf_codegen" name = "phf_codegen"
version = "0.11.3" version = "0.12.1"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "aef8048c789fa5e851558d709946d6d79a8ff88c0440c587967f8e94bfb1216a" checksum = "efbdcb6f01d193b17f0b9c3360fa7e0e620991b193ff08702f78b3ce365d7e61"
dependencies = [ dependencies = [
"phf_generator", "phf_generator 0.12.1",
"phf_shared", "phf_shared 0.12.1",
] ]
[[package]] [[package]]
@@ -3605,18 +3615,28 @@ version = "0.11.3"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "3c80231409c20246a13fddb31776fb942c38553c51e871f8cbd687a4cfb5843d" checksum = "3c80231409c20246a13fddb31776fb942c38553c51e871f8cbd687a4cfb5843d"
dependencies = [ dependencies = [
"phf_shared", "phf_shared 0.11.3",
"rand 0.8.5", "rand 0.8.5",
] ]
[[package]]
name = "phf_generator"
version = "0.12.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "2cbb1126afed61dd6368748dae63b1ee7dc480191c6262a3b4ff1e29d86a6c5b"
dependencies = [
"fastrand",
"phf_shared 0.12.1",
]
[[package]] [[package]]
name = "phf_macros" name = "phf_macros"
version = "0.11.3" version = "0.11.3"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "f84ac04429c13a7ff43785d75ad27569f2951ce0ffd30a3321230db2fc727216" checksum = "f84ac04429c13a7ff43785d75ad27569f2951ce0ffd30a3321230db2fc727216"
dependencies = [ dependencies = [
"phf_generator", "phf_generator 0.11.3",
"phf_shared", "phf_shared 0.11.3",
"proc-macro2", "proc-macro2",
"quote", "quote",
"syn 2.0.104", "syn 2.0.104",
@@ -3631,6 +3651,15 @@ dependencies = [
"siphasher", "siphasher",
] ]
[[package]]
name = "phf_shared"
version = "0.12.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "06005508882fb681fd97892ecff4b7fd0fee13ef1aa569f8695dae7ab9099981"
dependencies = [
"siphasher",
]
[[package]] [[package]]
name = "pico-args" name = "pico-args"
version = "0.5.0" version = "0.5.0"
@@ -4720,9 +4749,9 @@ dependencies = [
"iced", "iced",
"maxminddb", "maxminddb",
"pcap", "pcap",
"phf", "phf 0.12.1",
"phf_codegen", "phf_codegen",
"phf_shared", "phf_shared 0.12.1",
"plotters", "plotters",
"plotters-iced", "plotters-iced",
"reqwest", "reqwest",

View File

@@ -1,6 +1,7 @@
#[cfg(windows)] #[cfg(windows)]
extern crate winres; extern crate winres;
use std::borrow::Cow;
use std::env; use std::env;
use std::fs::File; use std::fs::File;
use std::io::{BufRead, BufReader, BufWriter, Write}; use std::io::{BufRead, BufReader, BufWriter, Write};
@@ -42,11 +43,11 @@ fn build_services_phf() {
let line = line_res.unwrap(); let line = line_res.unwrap();
let mut parts = line.split('\t'); let mut parts = line.split('\t');
// we want to panic if one of the service names is invalid // we want to panic if one of the service names is invalid
let val = get_valid_service_fmt_const(parts.next().unwrap()); let val = Cow::Owned(get_valid_service_fmt_const(parts.next().unwrap()));
// we want to panic if port is not a u16, or protocol is not TCP or UDP // we want to panic if port is not a u16, or protocol is not TCP or UDP
let key = get_valid_service_query(parts.next().unwrap()); let key = get_valid_service_query(parts.next().unwrap());
assert!(parts.next().is_none()); assert!(parts.next().is_none());
services_map.entry(key, &val); services_map.entry(key, val);
num_entries += 1; num_entries += 1;
} }
assert_eq!(num_entries, 12084); assert_eq!(num_entries, 12084);