diff --git a/Cargo.lock b/Cargo.lock index 7db06f15..296f36d7 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -28,47 +28,48 @@ dependencies = [ [[package]] name = "anstream" -version = "0.6.13" +version = "0.6.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d96bd03f33fe50a863e394ee9718a706f988b9079b20c3784fb726e7678b62fb" +checksum = "418c75fa768af9c03be99d17643f93f79bbba589895012a80e3452a19ddda15b" dependencies = [ "anstyle", "anstyle-parse", "anstyle-query", "anstyle-wincon", "colorchoice", + "is_terminal_polyfill", "utf8parse", ] [[package]] name = "anstyle" -version = "1.0.6" +version = "1.0.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8901269c6307e8d93993578286ac0edf7f195079ffff5ebdeea6a59ffb7e36bc" +checksum = "038dfcf04a5feb68e9c60b21c9625a54c2c0616e79b72b0fd87075a056ae1d1b" [[package]] name = "anstyle-parse" -version = "0.2.3" +version = "0.2.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c75ac65da39e5fe5ab759307499ddad880d724eed2f6ce5b5e8a26f4f387928c" +checksum = "c03a11a9034d92058ceb6ee011ce58af4a9bf61491aa7e1e59ecd24bd40d22d4" dependencies = [ "utf8parse", ] [[package]] name = "anstyle-query" -version = "1.0.2" +version = "1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e28923312444cdd728e4738b3f9c9cac739500909bb3d3c94b43551b16517648" +checksum = "ad186efb764318d35165f1758e7dcef3b10628e26d41a44bc5550652e6804391" dependencies = [ "windows-sys 0.52.0", ] [[package]] name = "anstyle-wincon" -version = "3.0.2" +version = "3.0.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1cd54b81ec8d6180e24654d0b371ad22fc3dd083b6ff8ba325b72e00c87660a7" +checksum = "61a38449feb7068f52bb06c12759005cf459ee52bb4adc1d5a7c4322d716fb19" dependencies = [ "anstyle", "windows-sys 0.52.0", @@ -76,9 +77,9 @@ dependencies = [ [[package]] name = "anyhow" -version = "1.0.81" +version = "1.0.86" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0952808a6c2afd1aa8947271f3a60f1a6763c7b912d210184c5149b5cf147247" +checksum = "b3d1d046238990b9cf5bcde22a3fb3584ee5cf65fb2765f454ed428c7a0063da" [[package]] name = "arbitrary" @@ -91,9 +92,20 @@ dependencies = [ [[package]] name = "autocfg" -version = "1.2.0" +version = "1.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f1fdabc7756949593fe60f30ec81974b613357de856987752631dea1e3394c80" +checksum = "0c4b4d0bd25bd0b74681c0ad21497610ce1b7c91b1022cd21c80c6fbdd9476b0" + +[[package]] +name = "automod" +version = "1.0.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "edf3ee19dbc0a46d740f6f0926bde8c50f02bdbc7b536842da28f6ac56513a8b" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.68", +] [[package]] name = "backtrace" @@ -133,15 +145,15 @@ checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a" [[package]] name = "bitflags" -version = "2.5.0" +version = "2.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cf4b9d6a944f767f8e5e0db018570623c85f3d925ac718db4e06d0187adb21c1" +checksum = "b048fb63fd8b5923fc5aa7b340d8e156aec7ec02f0c78fa8a6ddc2613f6f71de" [[package]] name = "camino" -version = "1.1.6" +version = "1.1.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c59e92b5a388f549b863a7bea62612c09f24c8393560709a54558a9abdfb3b9c" +checksum = "e0ec6b951b160caa93cc0c7b209e5a3bff7aae9062213451ac99493cd844c239" dependencies = [ "serde", ] @@ -171,9 +183,9 @@ dependencies = [ [[package]] name = "cc" -version = "1.0.90" +version = "1.0.101" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8cd6604a82acf3039f1144f54b8eb34e91ffba622051189e71b781822d5ee1f5" +checksum = "ac367972e516d45567c7eafc73d24e1c193dcf200a8d94e9db7b3d38b349572d" [[package]] name = "cfg-if" @@ -183,9 +195,9 @@ checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" [[package]] name = "clap" -version = "4.5.4" +version = "4.5.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "90bc066a67923782aa8515dbaea16946c5bcc5addbd668bb80af688e53e548a0" +checksum = "5db83dced34638ad474f39f250d7fea9598bdd239eaced1bdf45d597da0f433f" dependencies = [ "clap_builder", "clap_derive", @@ -193,9 +205,9 @@ dependencies = [ [[package]] name = "clap_builder" -version = "4.5.2" +version = "4.5.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ae129e2e766ae0ec03484e609954119f123cc1fe650337e155d03b022f24f7b4" +checksum = "f7e204572485eb3fbf28f871612191521df159bc3e15a9f5064c66dba3a8c05f" dependencies = [ "anstream", "anstyle", @@ -206,21 +218,21 @@ dependencies = [ [[package]] name = "clap_derive" -version = "4.5.4" +version = "4.5.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "528131438037fd55894f62d6e9f068b8f45ac57ffa77517819645d10aed04f64" +checksum = "c780290ccf4fb26629baa7a1081e68ced113f1d3ec302fa5948f1c381ebf06c6" dependencies = [ "heck 0.5.0", "proc-macro2", "quote", - "syn 2.0.58", + "syn 2.0.68", ] [[package]] name = "clap_lex" -version = "0.7.0" +version = "0.7.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "98cc8fbded0c607b7ba9dd60cd98df59af97e84d24e49c8557331cfc26d301ce" +checksum = "4b82cf0babdbd58558212896d1a4272303a57bdb245c2bf1147185fb45640e70" [[package]] name = "color-eyre" @@ -237,9 +249,9 @@ dependencies = [ [[package]] name = "colorchoice" -version = "1.0.0" +version = "1.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "acbf1af155f9b9ef647e42cdc158db4b64a1b61f743629225fde6f3e0be2a7c7" +checksum = "0b6a852b24ab71dffc585bcb46eaf7959d175cb865a7152e35b348d1b2960422" [[package]] name = "colored" @@ -304,9 +316,9 @@ dependencies = [ [[package]] name = "crossbeam-utils" -version = "0.8.19" +version = "0.8.20" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "248e3bacc7dc6baa3b21e405ee045c3047101a49145e7e9eca583ab4c2ca5345" +checksum = "22ec99545bb0ed0ea7bb9b8e1e9122ea386ff8a48c0922e43f36d45ab09e0e80" [[package]] name = "deranged" @@ -325,7 +337,7 @@ checksum = "67e77553c4162a157adbf834ebae5b415acbecbeafc7a74b0e886657506a7611" dependencies = [ "proc-macro2", "quote", - "syn 2.0.58", + "syn 2.0.68", ] [[package]] @@ -342,9 +354,9 @@ checksum = "56ce8c6da7551ec6c462cbaf3bfbc75131ebbfa1c944aeaa9dab51ca1c5f0c3b" [[package]] name = "either" -version = "1.10.0" +version = "1.13.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "11157ac094ffbdde99aa67b23417ebdd801842852b500e395a45a9c0aac03e4a" +checksum = "60b1af1c220855b6ceac025d3f6ecdd2b7c4894bfe9cd9bda4fbb4bc7c0d4cf0" [[package]] name = "encode_unicode" @@ -360,9 +372,9 @@ checksum = "5443807d6dff69373d433ab9ef5378ad8df50ca6298caf15de6e52e24aaf54d5" [[package]] name = "errno" -version = "0.3.8" +version = "0.3.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a258e46cdc063eb8519c00b9fc845fc47bcfca4130e2f08e88665ceda8474245" +checksum = "534c5cf6194dfab3db3242765c03bbe257cf92f22b38f6bc0c58d59108a820ba" dependencies = [ "libc", "windows-sys 0.52.0", @@ -380,9 +392,9 @@ dependencies = [ [[package]] name = "fastrand" -version = "2.0.2" +version = "2.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "658bd65b1cf4c852a3cc96f18a8ce7b5640f6b703f905c7d74532294c2a63984" +checksum = "9fc0510504f03c51ada170672ac806f1f105a88aa97a5281117e1ddc3368e51a" [[package]] name = "filetime" @@ -415,9 +427,9 @@ dependencies = [ [[package]] name = "getrandom" -version = "0.2.12" +version = "0.2.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "190092ea657667030ac6a35e305e62fc4dd69fd98ac98631e5d3a2b1575a12b5" +checksum = "c4567c8db10ae91089c99af84c68c38da3ec2f087c3f82960bcdbf3656b6f4d7" dependencies = [ "cfg-if", "libc", @@ -438,9 +450,9 @@ checksum = "d2fabcfbdc87f4758337ca535fb41a6d701b65693ce38287d856d1674551ec9b" [[package]] name = "hashbrown" -version = "0.14.3" +version = "0.14.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "290f1a1d9242c78d09ce40a5e87e7554ee637af1351968159f4952f028f75604" +checksum = "e5274423e17b7c9fc20b6e7e208532f9b19825d82dfd615708b70edd83df41f1" [[package]] name = "heck" @@ -491,9 +503,9 @@ dependencies = [ [[package]] name = "insta" -version = "1.38.0" +version = "1.39.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3eab73f58e59ca6526037208f0e98851159ec1633cf17b6cd2e1f2c3fd5d53cc" +checksum = "810ae6042d48e2c9e9215043563a58a80b877bc863228a74cf10c49d4620a6f5" dependencies = [ "console", "lazy_static", @@ -501,6 +513,12 @@ dependencies = [ "similar", ] +[[package]] +name = "is_terminal_polyfill" +version = "1.70.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f8478577c03552c21db0e2724ffb8986a5ce7af88107e6be5d2ee6e158c12800" + [[package]] name = "itertools" version = "0.12.1" @@ -518,15 +536,15 @@ checksum = "49f1f14873335454500d59611f1cf4a4b0f786f9ac11f4312a78e4cf2566695b" [[package]] name = "lazy_static" -version = "1.4.0" +version = "1.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e2abad23fbc42b3700f2f279844dc832adb2b2eb069b2df918f455c4e18cc646" +checksum = "bbd2bcb4c963f2ddae06a2efc7e9f3591312473c50c6685e1f298068316e66fe" [[package]] name = "libc" -version = "0.2.153" +version = "0.2.155" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9c198f91728a82281a64e1f4f9eeb25d82cb32a5de251c6bd1b5154d63a8e7bd" +checksum = "97b3888a4aecf77e811145cadf6eef5901f4782c53886191b2f693f24761847c" [[package]] name = "libm" @@ -542,15 +560,15 @@ checksum = "0717cef1bc8b636c6e1c1bbdefc09e6322da8a9321966e8928ef80d20f7f770f" [[package]] name = "linux-raw-sys" -version = "0.4.13" +version = "0.4.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "01cda141df6706de531b6c46c3a33ecca755538219bd484262fa09410c13539c" +checksum = "78b3ae25bc7c8c38cec158d1f2757ee79e9b3740fbc7ccf0e59e4b08d793fa89" [[package]] name = "log" -version = "0.4.21" +version = "0.4.22" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "90ed8c1e510134f979dbc4f070f87d4313098b704861a105fe34231c70a3901c" +checksum = "a7a70ba024b9dc04c27ea2f0c0548feb474ec5c54bba33a7f72f873a39d07b24" [[package]] name = "md5" @@ -560,9 +578,9 @@ checksum = "490cc448043f947bae3cbee9c203358d62dbee0db12107a74be5c30ccfd09771" [[package]] name = "memchr" -version = "2.7.2" +version = "2.7.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6c8640c5d730cb13ebd907d8d04b52f55ac9a2eec55b440c8892f40d56c76c1d" +checksum = "78ca9ab1a0babb1e7d5695e3530886289c18cf2f87ec19a575a0abdce112e3a3" [[package]] name = "memmap2" @@ -581,9 +599,9 @@ checksum = "68354c5c6bd36d73ff3feceb05efa59b6acb7626617f4962be322a825e61f79a" [[package]] name = "miniz_oxide" -version = "0.7.2" +version = "0.7.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9d811f3e15f28568be3407c8e7fdb6514c1cda3cb30683f15b6a1a1dc4ea14a7" +checksum = "b8a240ddb74feaf34a79a7add65a741f3167852fba007066dcac1ca548d89c08" dependencies = [ "adler", ] @@ -612,9 +630,9 @@ checksum = "51d515d32fb182ee37cda2ccdcb92950d6a3c2893aa280e540671c2cd0f3b1d9" [[package]] name = "num-traits" -version = "0.2.18" +version = "0.2.19" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "da0df0e5185db44f69b44f26786fe401b6c293d1907744beaa7fa62b2e5a517a" +checksum = "071dfc062690e90b734c0b2273ce72ad0ffa95f0c74596bc250dcfd960262841" dependencies = [ "autocfg", "libm", @@ -646,9 +664,9 @@ checksum = "3fdb12b2476b595f9358c5161aa467c2438859caa136dec86c26fdd2efe17b92" [[package]] name = "os_pipe" -version = "1.1.5" +version = "1.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "57119c3b893986491ec9aa85056780d3a0f3cf4da7cc09dd3650dbd6c6738fb9" +checksum = "29d73ba8daf8fac13b0501d1abeddcfe21ba7401ada61a819144b6c2a4f32209" dependencies = [ "libc", "windows-sys 0.52.0", @@ -690,22 +708,22 @@ dependencies = [ [[package]] name = "proc-macro2" -version = "1.0.79" +version = "1.0.86" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e835ff2298f5721608eb1a980ecaee1aef2c132bf95ecc026a11b7bf3c01c02e" +checksum = "5e719e8df665df0d1c8fbfd238015744736151d4445ec0836b8e628aae103b77" dependencies = [ "unicode-ident", ] [[package]] name = "proptest" -version = "1.4.0" +version = "1.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "31b476131c3c86cb68032fdc5cb6d5a1045e3e42d96b69fa599fd77701e1f5bf" +checksum = "b4c2511913b88df1637da85cc8d96ec8e43a3f8bb8ccb71ee1ac240d6f3df58d" dependencies = [ "bit-set", "bit-vec", - "bitflags 2.5.0", + "bitflags 2.6.0", "lazy_static", "num-traits", "rand 0.8.5", @@ -725,9 +743,9 @@ checksum = "a1d01941d82fa2ab50be1e79e6714289dd7cde78eba4c074bc5a4374f650dfe0" [[package]] name = "quote" -version = "1.0.35" +version = "1.0.36" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "291ec9ab5efd934aaf503a6466c5d5251535d108ee747472c3977cc5acc868ef" +checksum = "0fa76aaf39101c457836aec0ce2316dbdc3ab723cdda1c6bd4e6ad4208acaca7" dependencies = [ "proc-macro2", ] @@ -791,7 +809,7 @@ version = "0.6.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ec0be4795e2f6a28069bec0b5ff3e2ac9bafc99e6a9a7dc3547996c5c816922c" dependencies = [ - "getrandom 0.2.12", + "getrandom 0.2.15", ] [[package]] @@ -843,9 +861,9 @@ dependencies = [ [[package]] name = "regex" -version = "1.10.4" +version = "1.10.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c117dbdfde9c8308975b6a18d71f3f385c89461f7b3fb054288ecf2a2058ba4c" +checksum = "b91213439dad192326a0d7c6ee3955910425f441d7038e0d6933b0aec5c4517f" dependencies = [ "aho-corasick", "memchr", @@ -855,9 +873,9 @@ dependencies = [ [[package]] name = "regex-automata" -version = "0.4.6" +version = "0.4.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "86b83b8b9847f9bf95ef68afb0b8e6cdb80f498442f5179a29fad448fcc1eaea" +checksum = "38caf58cc5ef2fed281f89292ef23f6365465ed9a41b7a7754eb4e26496c92df" dependencies = [ "aho-corasick", "memchr", @@ -866,9 +884,9 @@ dependencies = [ [[package]] name = "regex-syntax" -version = "0.8.3" +version = "0.8.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "adad44e29e4c806119491a7f06f03de4d1af22c3a680dd47f1e6e179439d1f56" +checksum = "7a66a03ae7c801facd77a29370b4faec201768915ac14a721ba36f20bc9c209b" [[package]] name = "rsonpath" @@ -950,9 +968,9 @@ dependencies = [ [[package]] name = "rustc-demangle" -version = "0.1.23" +version = "0.1.24" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d626bb9dae77e28219937af045c257c28bfd3f69333c512553507f5f9798cb76" +checksum = "719b953e2095829ee67db738b3bfa9fa368c94900df327b3f07fe6e794d2fe1f" [[package]] name = "rustc_version" @@ -965,17 +983,17 @@ dependencies = [ [[package]] name = "rustflags" -version = "0.1.5" +version = "0.1.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e6d6e5ecce759f14333264b875a761e3d8159bcc79f527302b3537f17a9330ac" +checksum = "d7fc92159fb50a431c5da366f7627751fe7263cf867f8a30f27fa6063ba02ac0" [[package]] name = "rustix" -version = "0.38.32" +version = "0.38.34" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "65e04861e65f21776e67888bfbea442b3642beaa0138fdb1dd7a84a52dffdb89" +checksum = "70dc5ec042f7a43c4a73241207cecc9873a06d45debb38b329f8541d85c2730f" dependencies = [ - "bitflags 2.5.0", + "bitflags 2.6.0", "errno", "libc", "linux-raw-sys", @@ -984,9 +1002,9 @@ dependencies = [ [[package]] name = "rustversion" -version = "1.0.14" +version = "1.0.17" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7ffc183a10b4478d04cbbbfc96d0873219d962dd5accaff2ffbd4ceb7df837f4" +checksum = "955d28af4278de8121b7ebeb796b6a45735dc01436d898801014aced2773a3d6" [[package]] name = "rusty-fork" @@ -1002,9 +1020,9 @@ dependencies = [ [[package]] name = "ryu" -version = "1.0.17" +version = "1.0.18" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e86697c916019a8588c99b5fac3cead74ec0b4b819707a682fd4d23fa0ce1ba1" +checksum = "f3cb5ba0dc43242ce17de99c180e96db90b235b8a9fdc9543c96d2209116bd9f" [[package]] name = "same-file" @@ -1017,38 +1035,38 @@ dependencies = [ [[package]] name = "semver" -version = "1.0.22" +version = "1.0.23" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "92d43fe69e652f3df9bdc2b85b2854a0825b86e4fb76bc44d945137d053639ca" +checksum = "61697e0a1c7e512e84a621326239844a24d8207b4669b41bc18b32ea5cbf988b" dependencies = [ "serde", ] [[package]] name = "serde" -version = "1.0.197" +version = "1.0.203" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3fb1c873e1b9b056a4dc4c0c198b24c3ffa059243875552b2bd0933b1aee4ce2" +checksum = "7253ab4de971e72fb7be983802300c30b5a7f0c2e56fab8abfc6a214307c0094" dependencies = [ "serde_derive", ] [[package]] name = "serde_derive" -version = "1.0.197" +version = "1.0.203" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7eb0b34b42edc17f6b7cac84a52a1c5f0e1bb2227e997ca9011ea3dd34e8610b" +checksum = "500cbc0ebeb6f46627f50f3f5811ccf6bf00643be300b4c3eabc0ef55dc5b5ba" dependencies = [ "proc-macro2", "quote", - "syn 2.0.58", + "syn 2.0.68", ] [[package]] name = "serde_json" -version = "1.0.115" +version = "1.0.118" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "12dc5c46daa8e9fdf4f5e71b6cf9a53f2487da0e86e55808e2d35539666497dd" +checksum = "d947f6b3163d8857ea16c4fa0dd4840d52f3041039a85decd46867eb1abef2e4" dependencies = [ "itoa", "ryu", @@ -1057,9 +1075,9 @@ dependencies = [ [[package]] name = "serde_spanned" -version = "0.6.5" +version = "0.6.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "eb3622f419d1296904700073ea6cc23ad690adbd66f13ea683df73298736f0c1" +checksum = "79e674e01f999af37c49f70a6ede167a8a60b2503e56c5599532a65baa5969a0" dependencies = [ "serde", ] @@ -1096,9 +1114,9 @@ checksum = "3c5e1a9a646d36c3599cd173a41282daf47c44583ad367b8e6837255952e5c67" [[package]] name = "snapbox" -version = "0.5.9" +version = "0.6.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8ac441e1ecf678f68423d47f376d53fabce1afba92c8f68e31508eb27df8562a" +checksum = "40e14d10e4c2b4331ac24c33baa5a03e1fbca81c045b285b53b2a612d28569fb" dependencies = [ "anstream", "anstyle", @@ -1118,9 +1136,9 @@ dependencies = [ [[package]] name = "snapbox-macros" -version = "0.3.8" +version = "0.3.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e1c4b838b05d15ab22754068cb73500b2f3b07bf09d310e15b27f88160f1de40" +checksum = "b1f4c14672714436c09254801c934b203196a51182a5107fb76591c7cc56424d" dependencies = [ "anstream", ] @@ -1150,9 +1168,9 @@ dependencies = [ [[package]] name = "syn" -version = "2.0.58" +version = "2.0.68" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "44cfb93f38070beee36b3fef7d4f5a16f27751d94b187b666a5cc5e9b0d30687" +checksum = "901fa70d88b9d6c98022e23b4136f9f3e54e4662c3bc1bd1d84a42a9a0f0c1e9" dependencies = [ "proc-macro2", "quote", @@ -1199,7 +1217,7 @@ dependencies = [ "cfg-if", "proc-macro2", "quote", - "syn 2.0.58", + "syn 2.0.68", ] [[package]] @@ -1210,35 +1228,35 @@ checksum = "5c89e72a01ed4c579669add59014b9a524d609c0c88c6a585ce37485879f6ffb" dependencies = [ "proc-macro2", "quote", - "syn 2.0.58", + "syn 2.0.68", "test-case-core", ] [[package]] name = "thiserror" -version = "1.0.58" +version = "1.0.61" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "03468839009160513471e86a034bb2c5c0e4baae3b43f79ffc55c4a5427b3297" +checksum = "c546c80d6be4bc6a00c0f01730c08df82eaa7a7a61f11d656526506112cc1709" dependencies = [ "thiserror-impl", ] [[package]] name = "thiserror-impl" -version = "1.0.58" +version = "1.0.61" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c61f3ba182994efc43764a46c018c347bc492c79f024e705f46567b418f6d4f7" +checksum = "46c3384250002a6d5af4d114f2845d37b57521033f30d5c3f46c4d70e1197533" dependencies = [ "proc-macro2", "quote", - "syn 2.0.58", + "syn 2.0.68", ] [[package]] name = "time" -version = "0.3.34" +version = "0.3.36" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c8248b6521bb14bc45b4067159b9b6ad792e2d6d754d6c41fb50e29fefe38749" +checksum = "5dfd88e563464686c916c7e46e623e520ddc6d79fa6641390f2e3fa86e83e885" dependencies = [ "deranged", "itoa", @@ -1259,9 +1277,9 @@ checksum = "ef927ca75afb808a4d64dd374f00a2adf8d0fcff8e7b184af886c3c87ec4a3f3" [[package]] name = "time-macros" -version = "0.2.17" +version = "0.2.18" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7ba3a3ef41e6672a2f0f001392bb5dcd3ff0a9992d618ca761a11c3121547774" +checksum = "3f252a68540fde3a3877aeea552b832b40ab9a69e318efd078774a01ddee1ccf" dependencies = [ "num-conv", "time-core", @@ -1269,9 +1287,9 @@ dependencies = [ [[package]] name = "toml" -version = "0.8.12" +version = "0.8.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e9dd1545e8208b4a5af1aa9bbd0b4cf7e9ea08fabc5d0a5c67fcaafa17433aa3" +checksum = "6f49eb2ab21d2f26bd6db7bf383edc527a7ebaee412d17af4d40fdccd442f335" dependencies = [ "serde", "serde_spanned", @@ -1281,18 +1299,18 @@ dependencies = [ [[package]] name = "toml_datetime" -version = "0.6.5" +version = "0.6.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3550f4e9685620ac18a50ed434eb3aec30db8ba93b0287467bca5826ea25baf1" +checksum = "4badfd56924ae69bcc9039335b2e017639ce3f9b001c393c1b2d1ef846ce2cbf" dependencies = [ "serde", ] [[package]] name = "toml_edit" -version = "0.22.9" +version = "0.22.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8e40bb779c5187258fd7aad0eb68cb8706a0a81fa712fbea808ab43c4b8374c4" +checksum = "f21c7aaf97f1bd9ca9d4f9e73b0a6c74bd5afef56f2bc931943a6e1c37e04e38" dependencies = [ "indexmap", "serde", @@ -1303,10 +1321,11 @@ dependencies = [ [[package]] name = "trycmd" -version = "0.15.0" +version = "0.15.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "464edb3603a81a50b4c8f47b11dfade69ef48ffdc0af2f8b194ad87cbda75317" +checksum = "59709bd8eccada6a3fded26d22a7f2dcee406c18d3bd7ad2605ca3eeb8f6f6ec" dependencies = [ + "automod", "glob", "humantime", "humantime-serde", @@ -1337,15 +1356,15 @@ checksum = "d4c87d22b6e3f4a18d4d40ef354e97c90fcb14dd91d7dc0aa9d8a1172ebf7202" [[package]] name = "unicode-width" -version = "0.1.11" +version = "0.1.13" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e51733f11c9c4f72aa0c160008246859e340b00807569a0da0e7a1079b27ba85" +checksum = "0336d538f7abc86d282a4189614dfaa90810dfc2c6f6427eaf88e16311dd225d" [[package]] name = "utf8parse" -version = "0.2.1" +version = "0.2.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "711b9620af191e0cdc7468a8d14e709c3dcdb115b36f838e601583af800a370a" +checksum = "06abde3611657adf66d383f00b093d7faecc7fa57071cce2578660c9f1010821" [[package]] name = "vector-map" @@ -1403,37 +1422,15 @@ version = "0.11.0+wasi-snapshot-preview1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9c8d87e72b64a3b4db28d11ce29237c246188f4f51057d65a7eab63b7987e423" -[[package]] -name = "winapi" -version = "0.3.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5c839a674fcd7a98952e593242ea400abe93992746761e38641405d28b00f419" -dependencies = [ - "winapi-i686-pc-windows-gnu", - "winapi-x86_64-pc-windows-gnu", -] - -[[package]] -name = "winapi-i686-pc-windows-gnu" -version = "0.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ac3b87c63620426dd9b991e5ce0329eff545bccbbb34f3be09ff6fb6ab51b7b6" - [[package]] name = "winapi-util" -version = "0.1.6" +version = "0.1.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f29e6f9198ba0d26b4c9f07dbe6f9ed633e1f3d5b8b414090084349e46a52596" +checksum = "4d4cc384e1e73b93bafa6fb4f1df8c41695c8a91cf9c4c64358067d15a7b6c6b" dependencies = [ - "winapi", + "windows-sys 0.52.0", ] -[[package]] -name = "winapi-x86_64-pc-windows-gnu" -version = "0.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" - [[package]] name = "windows-sys" version = "0.48.0" @@ -1449,7 +1446,7 @@ version = "0.52.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "282be5f36a8ce781fad8c8ae18fa3f9beff57ec1b52cb3de0789201425d9a33d" dependencies = [ - "windows-targets 0.52.4", + "windows-targets 0.52.5", ] [[package]] @@ -1469,17 +1466,18 @@ dependencies = [ [[package]] name = "windows-targets" -version = "0.52.4" +version = "0.52.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7dd37b7e5ab9018759f893a1952c9420d060016fc19a472b4bb20d1bdd694d1b" +checksum = "6f0713a46559409d202e70e28227288446bf7841d3211583a4b53e3f6d96e7eb" dependencies = [ - "windows_aarch64_gnullvm 0.52.4", - "windows_aarch64_msvc 0.52.4", - "windows_i686_gnu 0.52.4", - "windows_i686_msvc 0.52.4", - "windows_x86_64_gnu 0.52.4", - "windows_x86_64_gnullvm 0.52.4", - "windows_x86_64_msvc 0.52.4", + "windows_aarch64_gnullvm 0.52.5", + "windows_aarch64_msvc 0.52.5", + "windows_i686_gnu 0.52.5", + "windows_i686_gnullvm", + "windows_i686_msvc 0.52.5", + "windows_x86_64_gnu 0.52.5", + "windows_x86_64_gnullvm 0.52.5", + "windows_x86_64_msvc 0.52.5", ] [[package]] @@ -1490,9 +1488,9 @@ checksum = "2b38e32f0abccf9987a4e3079dfb67dcd799fb61361e53e2882c3cbaf0d905d8" [[package]] name = "windows_aarch64_gnullvm" -version = "0.52.4" +version = "0.52.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bcf46cf4c365c6f2d1cc93ce535f2c8b244591df96ceee75d8e83deb70a9cac9" +checksum = "7088eed71e8b8dda258ecc8bac5fb1153c5cffaf2578fc8ff5d61e23578d3263" [[package]] name = "windows_aarch64_msvc" @@ -1502,9 +1500,9 @@ checksum = "dc35310971f3b2dbbf3f0690a219f40e2d9afcf64f9ab7cc1be722937c26b4bc" [[package]] name = "windows_aarch64_msvc" -version = "0.52.4" +version = "0.52.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "da9f259dd3bcf6990b55bffd094c4f7235817ba4ceebde8e6d11cd0c5633b675" +checksum = "9985fd1504e250c615ca5f281c3f7a6da76213ebd5ccc9561496568a2752afb6" [[package]] name = "windows_i686_gnu" @@ -1514,9 +1512,15 @@ checksum = "a75915e7def60c94dcef72200b9a8e58e5091744960da64ec734a6c6e9b3743e" [[package]] name = "windows_i686_gnu" -version = "0.52.4" +version = "0.52.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b474d8268f99e0995f25b9f095bc7434632601028cf86590aea5c8a5cb7801d3" +checksum = "88ba073cf16d5372720ec942a8ccbf61626074c6d4dd2e745299726ce8b89670" + +[[package]] +name = "windows_i686_gnullvm" +version = "0.52.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "87f4261229030a858f36b459e748ae97545d6f1ec60e5e0d6a3d32e0dc232ee9" [[package]] name = "windows_i686_msvc" @@ -1526,9 +1530,9 @@ checksum = "8f55c233f70c4b27f66c523580f78f1004e8b5a8b659e05a4eb49d4166cca406" [[package]] name = "windows_i686_msvc" -version = "0.52.4" +version = "0.52.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1515e9a29e5bed743cb4415a9ecf5dfca648ce85ee42e15873c3cd8610ff8e02" +checksum = "db3c2bf3d13d5b658be73463284eaf12830ac9a26a90c717b7f771dfe97487bf" [[package]] name = "windows_x86_64_gnu" @@ -1538,9 +1542,9 @@ checksum = "53d40abd2583d23e4718fddf1ebec84dbff8381c07cae67ff7768bbf19c6718e" [[package]] name = "windows_x86_64_gnu" -version = "0.52.4" +version = "0.52.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5eee091590e89cc02ad514ffe3ead9eb6b660aedca2183455434b93546371a03" +checksum = "4e4246f76bdeff09eb48875a0fd3e2af6aada79d409d33011886d3e1581517d9" [[package]] name = "windows_x86_64_gnullvm" @@ -1550,9 +1554,9 @@ checksum = "0b7b52767868a23d5bab768e390dc5f5c55825b6d30b86c844ff2dc7414044cc" [[package]] name = "windows_x86_64_gnullvm" -version = "0.52.4" +version = "0.52.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "77ca79f2451b49fa9e2af39f0747fe999fcda4f5e241b2898624dca97a1f2177" +checksum = "852298e482cd67c356ddd9570386e2862b5673c85bd5f88df9ab6802b334c596" [[package]] name = "windows_x86_64_msvc" @@ -1562,15 +1566,15 @@ checksum = "ed94fce61571a4006852b7389a063ab983c02eb1bb37b47f8272ce92d06d9538" [[package]] name = "windows_x86_64_msvc" -version = "0.52.4" +version = "0.52.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "32b752e52a2da0ddfbdbcc6fceadfeede4c939ed16d13e648833a61dfb611ed8" +checksum = "bec47e5bfd1bff0eeaf6d8b485cc1074891a197ab4225d504cb7a1ab88b02bf0" [[package]] name = "winnow" -version = "0.6.5" +version = "0.6.13" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dffa400e67ed5a4dd237983829e66475f0a4a26938c4b04c21baede6262215b8" +checksum = "59b5e5f6c299a3c7890b876a2a587f3115162487e704907d9b6cd29473052ba1" dependencies = [ "memchr", ] diff --git a/crates/rsonpath-lib/src/automaton.rs b/crates/rsonpath-lib/src/automaton.rs index 74c639dc..fde3311a 100644 --- a/crates/rsonpath-lib/src/automaton.rs +++ b/crates/rsonpath-lib/src/automaton.rs @@ -154,9 +154,9 @@ impl<'q> Automaton<'q> { /// /// # Errors /// - [`CompilerError::QueryTooComplex`] raised if the query is too complex - /// and the automaton size was exceeded. + /// and the automaton size was exceeded. /// - [`CompilerError::NotSupported`] raised if the query contains elements - /// not yet supported by the compiler. + /// not yet supported by the compiler. #[inline] pub fn new(query: &'q JsonPathQuery) -> Result { let nfa = NondeterministicAutomaton::new(query)?; diff --git a/crates/rsonpath-lib/src/automaton/array_transition_set.rs b/crates/rsonpath-lib/src/automaton/array_transition_set.rs index 83f1e94e..f6d2f589 100644 --- a/crates/rsonpath-lib/src/automaton/array_transition_set.rs +++ b/crates/rsonpath-lib/src/automaton/array_transition_set.rs @@ -28,6 +28,7 @@ //! * {prio. 2} over X intersect Y to S+{t} //! * {prio. 1} over X to S //! * {prio. 1} over Y to {t} +//! //! The semantics are correct as long as the transitions are taken in non-increasing order of priorities. //! //! Intersection of two linear sets is always a linear set. Finding such intersection is not trivial, diff --git a/crates/rsonpath-lib/src/automaton/minimizer.rs b/crates/rsonpath-lib/src/automaton/minimizer.rs index 37247fae..77861efe 100644 --- a/crates/rsonpath-lib/src/automaton/minimizer.rs +++ b/crates/rsonpath-lib/src/automaton/minimizer.rs @@ -60,9 +60,10 @@ struct SuperstateTransitionTable<'q> { * Every state with a self-loop becomes a checkpoint. They have two crucial properties: * 1. Any path from the initial to the accepting state goes through each checkpoint. * 2. Each superstate containing - * a) a checkpoint and; - * b) some states on the path from the initial state to that checkpoint, - * is equivalent to a superstate without the b) states. + * a) a checkpoint and; + * b) some states on the path from the initial state to that checkpoint, + * is equivalent to a superstate without the b) states. + * * This allows on-the-fly minimization with the `normalize` function, vastly reducing * the number of superstates to consider. * diff --git a/crates/rsonpath-lib/src/automaton/small_set.rs b/crates/rsonpath-lib/src/automaton/small_set.rs index 4950351e..833a8ea8 100644 --- a/crates/rsonpath-lib/src/automaton/small_set.rs +++ b/crates/rsonpath-lib/src/automaton/small_set.rs @@ -191,7 +191,9 @@ macro_rules! native_small_set { }; } -native_small_set!(SmallSet64, SmallSet64Iter, u64, 64); +// If a SmallSet64 is ever needed it can be constructed with the macro. +// native_small_set!(SmallSet64, SmallSet64Iter, u64, 64); +// Currently we only use SmallSet256 which relies on SmallSet128. native_small_set!(SmallSet128, SmallSet128Iter, u128, 128); impl From<[u8; N]> for SmallSet256 { diff --git a/crates/rsonpath-lib/src/classification.rs b/crates/rsonpath-lib/src/classification.rs index 5db853b1..9e9cfa56 100644 --- a/crates/rsonpath-lib/src/classification.rs +++ b/crates/rsonpath-lib/src/classification.rs @@ -1,11 +1,11 @@ //! Classifiers working on the input stream. //! //! - [`quotes`] contains the low-level [`QuoteClassifiedIterator`](`quotes::QuoteClassifiedIterator`) -//! computing basic information on which characters are escaped or within quotes. +//! computing basic information on which characters are escaped or within quotes. //! - [`structural`] contains the [`StructuralIterator`](`structural::StructuralIterator`) -//! that wraps over a quote classifier to extract a stream of [`Structural`](`structural::Structural`) characters. +//! that wraps over a quote classifier to extract a stream of [`Structural`](`structural::Structural`) characters. //! - [`depth`] contains the [`DepthIterator`](`depth::DepthIterator`) that works on top of a quote classifier -//! to provide quick fast-forwarding over the stream while keeping track of the depth. +//! to provide quick fast-forwarding over the stream while keeping track of the depth. //! //! This base module provides the [`ResumeClassifierState`] struct common between all //! higher-level classifiers that work on top of a [`QuoteClassifiedIterator`](`quotes::QuoteClassifiedIterator`). diff --git a/crates/rsonpath-lib/src/classification/memmem.rs b/crates/rsonpath-lib/src/classification/memmem.rs index b8b872d2..03430d3f 100644 --- a/crates/rsonpath-lib/src/classification/memmem.rs +++ b/crates/rsonpath-lib/src/classification/memmem.rs @@ -12,9 +12,9 @@ pub trait Memmem<'i, 'b, 'r, I: Input, const N: usize> { /// Find a member key identified by a given [`JsonString`]. /// /// - `first_block` – optional first block to search; if not provided, - /// the search will start at the next block returned by the underlying [`Input`] iterator. + /// the search will start at the next block returned by the underlying [`Input`] iterator. /// - `start_idx` – index of the start of search, either falling inside `first_block`, - /// or at the start of the next block. + /// or at the start of the next block. /// /// # Errors /// Errors when reading the underlying [`Input`] are propagated. diff --git a/crates/rsonpath-lib/src/classification/quotes/avx2_32.rs b/crates/rsonpath-lib/src/classification/quotes/avx2_32.rs index db2cc646..5ba28f19 100644 --- a/crates/rsonpath-lib/src/classification/quotes/avx2_32.rs +++ b/crates/rsonpath-lib/src/classification/quotes/avx2_32.rs @@ -31,9 +31,9 @@ impl BlockAvx2Classifier { } } -#[cfg(all(test, cfg = "avx_32"))] +#[cfg(test)] mod tests { - use super::Avx2QuoteClassifier32; + use super::{Constructor, QuotesImpl}; use crate::{ input::{Input, OwnedBytes}, result::empty::EmptyRecorder, @@ -41,18 +41,38 @@ mod tests { }; use test_case::test_case; - #[test_case("" => None)] - #[test_case("abcd" => Some(0))] - #[test_case(r#""abcd""# => Some(0b01_1111))] - #[test_case(r#""num": 42, "string": "something" "# => Some(0b0_0111_1111_1110_0011_1111_1000_0000_1111))] - #[test_case(r#"abc\"abc\""# => Some(0b00_0000_0000))] - #[test_case(r#"abc\\"abc\\""# => Some(0b0111_1110_0000))] - #[test_case(r#"{"aaa":[{},{"b":{"c":[1,2,3]}}],"# => Some(0b0000_0000_0000_0110_0011_0000_0001_1110))] - fn single_block(str: &str) -> Option { + #[test_case("", 0)] + #[test_case("abcd", 0)] + #[test_case(r#""abcd""#, 0b01_1111)] + #[test_case(r#""num": 42, "string": "something" "#, 0b0_0111_1111_1110_0011_1111_1000_0000_1111)] + #[test_case(r#"abc\"abc\""#, 0b00_0000_0000)] + #[test_case(r#"abc\\"abc\\""#, 0b0111_1110_0000)] + #[test_case(r#"{"aaa":[{},{"b":{"c":[1,2,3]}}],"#, 0b0000_0000_0000_0110_0011_0000_0001_1110)] + fn single_block(str: &str, expected: u32) { + if !std::arch::is_x86_feature_detected!("avx2") { + return; + } + let owned_str = str.to_owned(); - let input = OwnedBytes::new(&owned_str).unwrap(); + let input = OwnedBytes::from(owned_str); + let mut leading_padding = input.leading_padding_len() as u32; let iter = input.iter_blocks::<_, 32>(&EmptyRecorder); - let mut classifier = Avx2QuoteClassifier32::new(iter); - classifier.next().unwrap().map(|x| x.within_quotes_mask) + let mut classifier = Constructor::new(iter); + + // Drop padding-only blocks. + while leading_padding >= 32 { + let mask = classifier.next().unwrap().unwrap().within_quotes_mask; + assert_eq!(mask, 0); + leading_padding -= 32; + } + + // The actual classification is now either contained in the next block, + // or split between the two next blocks. Combine them. + let first_mask = classifier.next().unwrap().unwrap().within_quotes_mask; + let len_in_first_mask = if leading_padding == 0 { 0 } else { 32 - leading_padding }; + let second_mask = classifier.next().unwrap().unwrap().within_quotes_mask; + let combined_mask = (first_mask >> leading_padding) | (second_mask << len_in_first_mask); + + assert_eq!(combined_mask, expected); } } diff --git a/crates/rsonpath-lib/src/classification/quotes/avx2_64.rs b/crates/rsonpath-lib/src/classification/quotes/avx2_64.rs index aba52aeb..b7be43df 100644 --- a/crates/rsonpath-lib/src/classification/quotes/avx2_64.rs +++ b/crates/rsonpath-lib/src/classification/quotes/avx2_64.rs @@ -33,9 +33,9 @@ impl BlockAvx2Classifier { } } -#[cfg(all(test, cfg = "avx_64"))] +#[cfg(test)] mod tests { - use super::Avx2QuoteClassifier64; + use super::{Constructor, QuotesImpl}; use crate::{ input::{Input, OwnedBytes}, result::empty::EmptyRecorder, @@ -43,18 +43,38 @@ mod tests { }; use test_case::test_case; - #[test_case("" => None)] - #[test_case("abcd" => Some(0))] - #[test_case(r#""abcd""# => Some(0b01_1111))] - #[test_case(r#""number": 42, "string": "something" "# => Some(0b0011_1111_1111_0001_1111_1100_0000_0111_1111))] - #[test_case(r#"abc\"abc\""# => Some(0b00_0000_0000))] - #[test_case(r#"abc\\"abc\\""# => Some(0b0111_1110_0000))] - #[test_case(r#"{"aaa":[{},{"b":{"c":[1,2,3]}}],"e":{"a":[[],[1,2,3],"# => Some(0b0_0000_0000_0000_0110_0011_0000_0000_0000_0110_0011_0000_0001_1110))] - fn single_block(str: &str) -> Option { + #[test_case("", 0)] + #[test_case("abcd", 0)] + #[test_case(r#""abcd""#, 0b01_1111)] + #[test_case(r#""num": 42, "string": "something" "#, 0b0_0111_1111_1110_0011_1111_1000_0000_1111)] + #[test_case(r#"abc\"abc\""#, 0b00_0000_0000)] + #[test_case(r#"abc\\"abc\\""#, 0b0111_1110_0000)] + #[test_case(r#"{"aaa":[{},{"b":{"c":[1,2,3]}}],"#, 0b0000_0000_0000_0110_0011_0000_0001_1110)] + fn single_block(str: &str, expected: u64) { + if !std::arch::is_x86_feature_detected!("avx2") { + return; + } + let owned_str = str.to_owned(); - let input = OwnedBytes::new(&owned_str).unwrap(); + let input = OwnedBytes::from(owned_str); + let mut leading_padding = input.leading_padding_len() as u64; let iter = input.iter_blocks::<_, 64>(&EmptyRecorder); - let mut classifier = Avx2QuoteClassifier64::new(iter); - classifier.next().unwrap().map(|x| x.within_quotes_mask) + let mut classifier = Constructor::new(iter); + + // Drop padding-only blocks. + while leading_padding >= 64 { + let mask = classifier.next().unwrap().unwrap().within_quotes_mask; + assert_eq!(mask, 0); + leading_padding -= 64; + } + + // The actual classification is now either contained in the next block, + // or split between the two next blocks. Combine them. + let first_mask = classifier.next().unwrap().unwrap().within_quotes_mask; + let len_in_first_mask = if leading_padding == 0 { 0 } else { 64 - leading_padding }; + let second_mask = classifier.next().unwrap().unwrap().within_quotes_mask; + let combined_mask = (first_mask >> leading_padding) | (second_mask << len_in_first_mask); + + assert_eq!(combined_mask, expected); } } diff --git a/crates/rsonpath-lib/src/classification/quotes/sse2_32.rs b/crates/rsonpath-lib/src/classification/quotes/sse2_32.rs index 2493a9d4..beed923c 100644 --- a/crates/rsonpath-lib/src/classification/quotes/sse2_32.rs +++ b/crates/rsonpath-lib/src/classification/quotes/sse2_32.rs @@ -34,9 +34,9 @@ impl BlockSse2Classifier { } } -#[cfg(all(test, cfg = "ssse3_32"))] +#[cfg(test)] mod tests { - use super::Sse2QuoteClassifier32; + use super::{Constructor, QuotesImpl}; use crate::{ input::{Input, OwnedBytes}, result::empty::EmptyRecorder, @@ -44,18 +44,38 @@ mod tests { }; use test_case::test_case; - #[test_case("" => None)] - #[test_case("abcd" => Some(0))] - #[test_case(r#""abcd""# => Some(0b01_1111))] - #[test_case(r#""num": 42, "string": "something" "# => Some(0b0_0111_1111_1110_0011_1111_1000_0000_1111))] - #[test_case(r#"abc\"abc\""# => Some(0b00_0000_0000))] - #[test_case(r#"abc\\"abc\\""# => Some(0b0111_1110_0000))] - #[test_case(r#"{"aaa":[{},{"b":{"c":[1,2,3]}}],"# => Some(0b0000_0000_0000_0110_0011_0000_0001_1110))] - fn single_block(str: &str) -> Option { + #[test_case("", 0)] + #[test_case("abcd", 0)] + #[test_case(r#""abcd""#, 0b01_1111)] + #[test_case(r#""num": 42, "string": "something" "#, 0b0_0111_1111_1110_0011_1111_1000_0000_1111)] + #[test_case(r#"abc\"abc\""#, 0b00_0000_0000)] + #[test_case(r#"abc\\"abc\\""#, 0b0111_1110_0000)] + #[test_case(r#"{"aaa":[{},{"b":{"c":[1,2,3]}}],"#, 0b0000_0000_0000_0110_0011_0000_0001_1110)] + fn single_block(str: &str, expected: u32) { + if !std::arch::is_x86_feature_detected!("sse2") { + return; + } + let owned_str = str.to_owned(); - let input = OwnedBytes::new(&owned_str).unwrap(); + let input = OwnedBytes::from(owned_str); + let mut leading_padding = input.leading_padding_len() as u32; let iter = input.iter_blocks::<_, 32>(&EmptyRecorder); - let mut classifier = Sse2QuoteClassifier32::new(iter); - classifier.next().unwrap().map(|x| x.within_quotes_mask) + let mut classifier = Constructor::new(iter); + + // Drop padding-only blocks. + while leading_padding >= 32 { + let mask = classifier.next().unwrap().unwrap().within_quotes_mask; + assert_eq!(mask, 0); + leading_padding -= 32; + } + + // The actual classification is now either contained in the next block, + // or split between the two next blocks. Combine them. + let first_mask = classifier.next().unwrap().unwrap().within_quotes_mask; + let len_in_first_mask = if leading_padding == 0 { 0 } else { 32 - leading_padding }; + let second_mask = classifier.next().unwrap().unwrap().within_quotes_mask; + let combined_mask = (first_mask >> leading_padding) | (second_mask << len_in_first_mask); + + assert_eq!(combined_mask, expected); } } diff --git a/crates/rsonpath-lib/src/classification/quotes/sse2_64.rs b/crates/rsonpath-lib/src/classification/quotes/sse2_64.rs index 4fdde5cb..a79b6f7d 100644 --- a/crates/rsonpath-lib/src/classification/quotes/sse2_64.rs +++ b/crates/rsonpath-lib/src/classification/quotes/sse2_64.rs @@ -46,9 +46,9 @@ impl BlockSse2Classifier { } } -#[cfg(all(test, cfg = "ssse3_64"))] +#[cfg(test)] mod tests { - use super::Sse2QuoteClassifier64; + use super::{Constructor, QuotesImpl}; use crate::{ input::{Input, OwnedBytes}, result::empty::EmptyRecorder, @@ -56,18 +56,37 @@ mod tests { }; use test_case::test_case; - #[test_case("" => None)] - #[test_case("abcd" => Some(0))] - #[test_case(r#""abcd""# => Some(0b01_1111))] - #[test_case(r#""number": 42, "string": "something" "# => Some(0b0011_1111_1111_0001_1111_1100_0000_0111_1111))] - #[test_case(r#"abc\"abc\""# => Some(0b00_0000_0000))] - #[test_case(r#"abc\\"abc\\""# => Some(0b0111_1110_0000))] - #[test_case(r#"{"aaa":[{},{"b":{"c":[1,2,3]}}],"e":{"a":[[],[1,2,3],"# => Some(0b0_0000_0000_0000_0110_0011_0000_0000_0000_0110_0011_0000_0001_1110))] - fn single_block(str: &str) -> Option { + #[test_case("", 0)] + #[test_case("abcd", 0)] + #[test_case(r#""abcd""#, 0b01_1111)] + #[test_case(r#""num": 42, "string": "something" "#, 0b0_0111_1111_1110_0011_1111_1000_0000_1111)] + #[test_case(r#"abc\"abc\""#, 0b00_0000_0000)] + #[test_case(r#"abc\\"abc\\""#, 0b0111_1110_0000)] + #[test_case(r#"{"aaa":[{},{"b":{"c":[1,2,3]}}],"#, 0b0000_0000_0000_0110_0011_0000_0001_1110)] + fn single_block(str: &str, expected: u64) { + if !std::arch::is_x86_feature_detected!("sse2") { + return; + } + let owned_str = str.to_owned(); - let input = OwnedBytes::new(&owned_str).unwrap(); + let input = OwnedBytes::from(owned_str); + let mut leading_padding = input.leading_padding_len() as u64; let iter = input.iter_blocks::<_, 64>(&EmptyRecorder); - let mut classifier = Sse2QuoteClassifier64::new(iter); - classifier.next().unwrap().map(|x| x.within_quotes_mask) + let mut classifier = Constructor::new(iter); + + // Drop padding-only blocks. + while leading_padding >= 64 { + let mask = classifier.next().unwrap().unwrap().within_quotes_mask; + assert_eq!(mask, 0); + leading_padding -= 64; + } + // The actual classification is now either contained in the next block, + // or split between the two next blocks. Combine them. + let first_mask = classifier.next().unwrap().unwrap().within_quotes_mask; + let len_in_first_mask = if leading_padding == 0 { 0 } else { 64 - leading_padding }; + let second_mask = classifier.next().unwrap().unwrap().within_quotes_mask; + let combined_mask = (first_mask >> leading_padding) | (second_mask << len_in_first_mask); + + assert_eq!(combined_mask, expected); } } diff --git a/crates/rsonpath-lib/src/input/borrowed.rs b/crates/rsonpath-lib/src/input/borrowed.rs index d796dd01..018bd082 100644 --- a/crates/rsonpath-lib/src/input/borrowed.rs +++ b/crates/rsonpath-lib/src/input/borrowed.rs @@ -3,7 +3,7 @@ //! Choose this implementation if: //! //! 1. You already have the data loaded in-memory and can borrow it while -//! using the engine. +//! using the engine. //! //! ## Performance characteristics //! diff --git a/crates/rsonpath-lib/src/input/buffered.rs b/crates/rsonpath-lib/src/input/buffered.rs index 2aa60f68..6a67d33d 100644 --- a/crates/rsonpath-lib/src/input/buffered.rs +++ b/crates/rsonpath-lib/src/input/buffered.rs @@ -4,7 +4,7 @@ //! Choose this implementation if: //! //! 1. You have a [`Read`] source that might contain relatively large amounts -//! of data. +//! of data. //! 2. You want to run the JSONPath query on the input and then discard it. //! //! ## Performance characteristics diff --git a/crates/rsonpath-lib/src/input/mmap.rs b/crates/rsonpath-lib/src/input/mmap.rs index 04c75ce7..c0a768b4 100644 --- a/crates/rsonpath-lib/src/input/mmap.rs +++ b/crates/rsonpath-lib/src/input/mmap.rs @@ -4,10 +4,10 @@ //! //! 1. Your platform supports memory maps. //! 2. The input data is in a file or comes from standard input: -//! a) if from a file, then you can guarantee that the file is not going to be modified -//! in or out of process while the input is alive; -//! b) if from stdin, then that the input lives in memory (for example comes via a pipe); -//! input from a tty is not memory-mappable. +//! a) if from a file, then you can guarantee that the file is not going to be modified +//! in or out of process while the input is alive; +//! b) if from stdin, then that the input lives in memory (for example comes via a pipe); +//! input from a tty is not memory-mappable. //! //! ## Performance characteristics //! diff --git a/crates/rsonpath-lib/src/input/owned.rs b/crates/rsonpath-lib/src/input/owned.rs index 1aa77633..23b9bdac 100644 --- a/crates/rsonpath-lib/src/input/owned.rs +++ b/crates/rsonpath-lib/src/input/owned.rs @@ -4,7 +4,7 @@ //! //! 1. You already have the data loaded in-memory. //! 2. You don't want to deal with ownership and would rather have the input -//! take ownership of the bytes. +//! take ownership of the bytes. //! //! ## Performance characteristics //! diff --git a/crates/rsonpath-syntax/src/lib.rs b/crates/rsonpath-syntax/src/lib.rs index aa894fb3..29022067 100644 --- a/crates/rsonpath-syntax/src/lib.rs +++ b/crates/rsonpath-syntax/src/lib.rs @@ -211,6 +211,7 @@ impl ParserBuilder { /// JSONPath queries are inherently recursive, since /// - [`LogicalExpr`] can be an arbitrarily deep tree of AND/OR operators; /// - the [`TestExpr`] in a filter can test arbitrary nested JSONPath queries. + /// /// Our parser implementation is recursive, so an excessively nested query could overflow the stack. /// /// The limit can be relaxed here, or removed entirely by passing [`None`]. diff --git a/deny.toml b/deny.toml index b20d3236..ad83c476 100644 --- a/deny.toml +++ b/deny.toml @@ -10,7 +10,7 @@ # when any section or field is not specified in your own configuration # Root options - +[graph] # If 1 or more target triples (and optionally, target_features) are specified, # only the specified targets will be checked when running `cargo deny check`. # This means, if a particular package is only ever used as a target specific @@ -46,6 +46,8 @@ no-default-features = false # If set, these feature will be enabled when collecting metadata. If `--features` # is specified on the cmd line they will take precedence over this option. #features = [] + +[output] # When outputting inclusion graphs in diagnostics that include features, this # option can be used to specify the depth at which feature edges will be added. # This option is included since the graphs can be quite large and the addition @@ -61,30 +63,13 @@ feature-depth = 1 db-path = "~/.cargo/advisory-db" # The url(s) of the advisory databases to use db-urls = ["https://github.com/rustsec/advisory-db"] -# The lint level for security vulnerabilities -vulnerability = "deny" -# The lint level for unmaintained crates -unmaintained = "warn" # The lint level for crates that have been yanked from their source registry yanked = "warn" -# The lint level for crates with security notices. Note that as of -# 2019-12-17 there are no security notice advisories in -# https://github.com/rustsec/advisory-db -notice = "warn" # A list of advisory IDs to ignore. Note that ignored advisories will still # output a note when they are encountered. ignore = [ #"RUSTSEC-0000-0000", ] -# Threshold for security vulnerabilities, any vulnerability with a CVSS score -# lower than the range specified will be ignored. Note that ignored advisories -# will still output a note when they are encountered. -# * None - CVSS Score 0.0 -# * Low - CVSS Score 0.1 - 3.9 -# * Medium - CVSS Score 4.0 - 6.9 -# * High - CVSS Score 7.0 - 8.9 -# * Critical - CVSS Score 9.0 - 10.0 -severity-threshold = "Medium" # If this is true, then cargo deny will use the git executable to fetch advisory database. # If this is false, then it uses a built-in git library. @@ -96,38 +81,16 @@ severity-threshold = "Medium" # More documentation for the licenses section can be found here: # https://embarkstudios.github.io/cargo-deny/checks/licenses/cfg.html [licenses] -# The lint level for crates which do not have a detectable license -unlicensed = "deny" # List of explicitly allowed licenses # See https://spdx.org/licenses/ for list of possible licenses # [possible values: any SPDX 3.11 short identifier (+ optional exception)]. allow = [ - #"MIT", - #"Apache-2.0", - #"Apache-2.0 WITH LLVM-exception", + "MIT", + "Apache-2.0", + "Apache-2.0 WITH LLVM-exception", + "Unicode-DFS-2016", ] -# List of explicitly disallowed licenses -# See https://spdx.org/licenses/ for list of possible licenses -# [possible values: any SPDX 3.11 short identifier (+ optional exception)]. -deny = [ - #"Nokia", -] -# Lint level for licenses considered copyleft -copyleft = "warn" -# Blanket approval or denial for OSI-approved or FSF Free/Libre licenses -# * both - The license will be approved if it is both OSI-approved *AND* FSF -# * either - The license will be approved if it is either OSI-approved *OR* FSF -# * osi - The license will be approved if it is OSI approved -# * fsf - The license will be approved if it is FSF Free -# * osi-only - The license will be approved if it is OSI-approved *AND NOT* FSF -# * fsf-only - The license will be approved if it is FSF *AND NOT* OSI-approved -# * neither - This predicate is ignored and the default lint level is used -allow-osi-fsf-free = "osi" -# Lint level used when no other predicates are matched -# 1. License isn't in the allow or deny lists -# 2. License isn't copyleft -# 3. License isn't OSI/FSF, or allow-osi-fsf-free = "neither" -default = "deny" + # The confidence threshold for detecting a license from license text. # The higher the value, the more closely the license text must be to the # canonical license text of a valid SPDX license file.