diff --git a/.gitignore b/.gitignore index e39a270..eaebc80 100644 --- a/.gitignore +++ b/.gitignore @@ -1,5 +1,5 @@ /target - +*.hdt *.hdt.index.v1-1 *.hdt.index.v1-rust-cache tests/resources/taxonomy-nodes.nq diff --git a/Cargo.lock b/Cargo.lock index 5f08570..e47e8f8 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -522,6 +522,12 @@ dependencies = [ "syn 2.0.100", ] +[[package]] +name = "equivalent" +version = "1.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "877a4ace8713b0bcf2a4e7eec82529c029f1d0619886d18145fea96c3ffe5c0f" + [[package]] name = "errno" version = "0.3.10" @@ -670,6 +676,12 @@ dependencies = [ "crunchy", ] +[[package]] +name = "hashbrown" +version = "0.15.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5971ac85611da7067dbfcabef3c70ebb5606018acd9e2a3903a0da507521e0d5" + [[package]] name = "hdt" version = "0.3.0" @@ -706,6 +718,15 @@ version = "0.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b07f60793ff0a4d9cef0f18e63b5357e06209987153a64648c972c1e5aff336f" +[[package]] +name = "home" +version = "0.5.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "589533453244b0995c858700322199b2becb13b627df2851f64a2775d024abcf" +dependencies = [ + "windows-sys", +] + [[package]] name = "iana-time-zone" version = "0.1.62" @@ -736,6 +757,16 @@ version = "0.3.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ce23b50ad8242c51a442f3ff322d56b02f08852c77e4c0b4d3fd684abc89c683" +[[package]] +name = "indexmap" +version = "2.10.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fe4cd85333e22411419a0bcae1297d25e58c9443848b11dc6a86fefe8c78a661" +dependencies = [ + "equivalent", + "hashbrown", +] + [[package]] name = "indoc" version = "2.0.6" @@ -851,6 +882,12 @@ version = "0.2.171" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c19937216e9d3aa9956d9bb8dfc0b0c8beb6058fc4f7a4dc4d850edf86a237d6" +[[package]] +name = "linux-raw-sys" +version = "0.4.15" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d26c52dbd32dccf2d10cac7725f8eae5296885fb5703b261f7d0a0739ec807ab" + [[package]] name = "linux-raw-sys" version = "0.9.3" @@ -1034,29 +1071,6 @@ dependencies = [ "thiserror 2.0.12", ] -[[package]] -name = "parking_lot" -version = "0.12.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f1bf18183cf54e8d6059647fc3063646a1801cf30896933ec2311622cc4b9a27" -dependencies = [ - "lock_api", - "parking_lot_core", -] - -[[package]] -name = "parking_lot_core" -version = "0.9.10" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1e401f977ab385c9e4e3ab30627d6f26d00e2c73eef317493c4ec6d468726cf8" -dependencies = [ - "cfg-if", - "libc", - "redox_syscall", - "smallvec", - "windows-targets", -] - [[package]] name = "pct-str" version = "2.0.0" @@ -1133,9 +1147,9 @@ dependencies = [ [[package]] name = "pprof" -version = "0.14.0" +version = "0.15.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ebbe2f8898beba44815fdc9e5a4ae9c929e21c5dc29b0c774a15555f7f58d6d0" +checksum = "38a01da47675efa7673b032bf8efd8214f1917d89685e07e395ab125ea42b187" dependencies = [ "aligned-vec", "backtrace", @@ -1146,13 +1160,13 @@ dependencies = [ "log", "nix", "once_cell", - "parking_lot", "protobuf", - "protobuf-codegen-pure", + "protobuf-codegen", "smallvec", + "spin", "symbolic-demangle", "tempfile", - "thiserror 1.0.69", + "thiserror 2.0.12", ] [[package]] @@ -1199,27 +1213,53 @@ dependencies = [ [[package]] name = "protobuf" -version = "2.28.0" +version = "3.7.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "106dd99e98437432fed6519dedecfade6a06a73bb7b2a1e019fdd2bee5778d94" +checksum = "d65a1d4ddae7d8b5de68153b48f6aa3bba8cb002b243dbdbc55a5afbc98f99f4" +dependencies = [ + "once_cell", + "protobuf-support", + "thiserror 1.0.69", +] [[package]] name = "protobuf-codegen" -version = "2.28.0" +version = "3.7.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "033460afb75cf755fcfc16dfaed20b86468082a2ea24e05ac35ab4a099a017d6" +checksum = "5d3976825c0014bbd2f3b34f0001876604fe87e0c86cd8fa54251530f1544ace" dependencies = [ + "anyhow", + "once_cell", "protobuf", + "protobuf-parse", + "regex", + "tempfile", + "thiserror 1.0.69", ] [[package]] -name = "protobuf-codegen-pure" -version = "2.28.0" +name = "protobuf-parse" +version = "3.7.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "95a29399fc94bcd3eeaa951c715f7bea69409b2445356b00519740bcd6ddd865" +checksum = "b4aeaa1f2460f1d348eeaeed86aea999ce98c1bded6f089ff8514c9d9dbdc973" dependencies = [ + "anyhow", + "indexmap", + "log", "protobuf", - "protobuf-codegen", + "protobuf-support", + "tempfile", + "thiserror 1.0.69", + "which", +] + +[[package]] +name = "protobuf-support" +version = "3.7.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3e36c2f31e0a47f9280fb347ef5e461ffcd2c52dd520d8e216b52f93b0b0d7d6" +dependencies = [ + "thiserror 1.0.69", ] [[package]] @@ -1328,15 +1368,6 @@ dependencies = [ "walkdir", ] -[[package]] -name = "redox_syscall" -version = "0.5.11" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d2f103c6d277498fbceb16e84d317e2a400f160f46904d5f5410848c829511a3" -dependencies = [ - "bitflags 2.9.0", -] - [[package]] name = "regex" version = "1.11.1" @@ -1395,6 +1426,19 @@ version = "0.1.24" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "719b953e2095829ee67db738b3bfa9fa368c94900df327b3f07fe6e794d2fe1f" +[[package]] +name = "rustix" +version = "0.38.44" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fdb5bc1ae2baa591800df16c9ca78619bf65c0488b41b96ccec5d11220d8c154" +dependencies = [ + "bitflags 2.9.0", + "errno", + "libc", + "linux-raw-sys 0.4.15", + "windows-sys", +] + [[package]] name = "rustix" version = "1.0.3" @@ -1404,7 +1448,7 @@ dependencies = [ "bitflags 2.9.0", "errno", "libc", - "linux-raw-sys", + "linux-raw-sys 0.9.3", "windows-sys", ] @@ -1625,6 +1669,15 @@ dependencies = [ "sophia_rio", ] +[[package]] +name = "spin" +version = "0.10.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d5fe4ccb98d9c292d56fec89a5e07da7fc4cf0dc11e156b41793132775d3e591" +dependencies = [ + "lock_api", +] + [[package]] name = "stable_deref_trait" version = "1.2.0" @@ -1720,7 +1773,7 @@ dependencies = [ "fastrand", "getrandom 0.3.2", "once_cell", - "rustix", + "rustix 1.0.3", "windows-sys", ] @@ -1913,6 +1966,18 @@ dependencies = [ "wasm-bindgen", ] +[[package]] +name = "which" +version = "4.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "87ba24419a2078cd2b0f2ede2691b6c66d8e47836da3b6db8265ebad47afbfc7" +dependencies = [ + "either", + "home", + "once_cell", + "rustix 0.38.44", +] + [[package]] name = "winapi" version = "0.3.9" diff --git a/Cargo.toml b/Cargo.toml index 0cb7cc8..c4292cd 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -29,7 +29,7 @@ tempfile = "3.19" [dev-dependencies] criterion = { version = "0.5", features = ["async_tokio"]} -pprof = { version = "0.14", features = ["protobuf", "protobuf-codec", "criterion"] } +pprof = { version = "0.15", features = ["protobuf", "protobuf-codec", "criterion"] } walkdir = "2.5" [package.metadata.cargo-machete] diff --git a/src/builder.rs b/src/builder.rs index 327ba2b..6a36daf 100644 --- a/src/builder.rs +++ b/src/builder.rs @@ -331,7 +331,7 @@ mod tests { let hdt_reader = BufReader::new(source); let h = Hdt::new(hdt_reader).expect("failed to load HDT file"); let t: Vec<(Arc, Arc, Arc)> = h.triples().collect(); - println!("{:?}", t); + println!("{t:?}"); assert_eq!(t.len(), 9); // http://example.org/apple#Apple,http://example.org/apple#color,Red diff --git a/src/dictionary.rs b/src/dictionary.rs index e397bb7..515ed06 100644 --- a/src/dictionary.rs +++ b/src/dictionary.rs @@ -64,7 +64,7 @@ impl FourSectDictBuilder { let source = match std::fs::File::open(nt_file) { Ok(f) => f, Err(e) => { - error!("Error opening file {:?}: {:?}", nt_file, e); + error!("Error opening file {nt_file:?}: {e:?}"); return Err(e.into()); } }; @@ -145,7 +145,7 @@ impl FourSectDictBuilder { let source = match std::fs::File::open(nt_file) { Ok(f) => f, Err(e) => { - error!("Error opening file {:?}: {:?}", nt_file, e); + error!("Error opening file {nt_file:?}: {e:?}"); return Err(e.into()); } }; diff --git a/src/main.rs b/src/main.rs index 98e5052..cc0d076 100644 --- a/src/main.rs +++ b/src/main.rs @@ -96,7 +96,7 @@ fn main() { }, ) { Ok(_) => {} - Err(e) => eprintln!("Error writing: {}", e), + Err(e) => eprintln!("Error writing: {e}"), } } None => {} diff --git a/src/rdf_reader.rs b/src/rdf_reader.rs index fb9e764..d855f2f 100644 --- a/src/rdf_reader.rs +++ b/src/rdf_reader.rs @@ -23,7 +23,7 @@ pub fn convert_to_nt( let source = match std::fs::File::open(&file) { Ok(f) => f, Err(e) => { - error!("Error opening file {:?}: {:?}", file, e); + error!("Error opening file {file:?}: {e:?}"); return Err(e.into()); } };