From bb3857d0182477a98d720a5e0f50666867937422 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Joakim=20Frosteg=C3=A5rd?= Date: Sat, 3 Jun 2023 17:55:47 +0200 Subject: [PATCH 1/5] Run cargo update Updating base64 v0.21.0 -> v0.21.2 Updating bumpalo v3.12.1 -> v3.13.0 Updating cache-padded v1.2.0 -> v1.3.0 Updating ciborium v0.2.0 -> v0.2.1 Updating ciborium-io v0.2.0 -> v0.2.1 Updating ciborium-ll v0.2.0 -> v0.2.1 Updating console v0.15.5 -> v0.15.7 Updating digest v0.10.6 -> v0.10.7 Updating indicatif v0.17.3 -> v0.17.4 Updating js-sys v0.3.61 -> v0.3.63 Updating libc v0.2.142 -> v0.2.144 Updating libm v0.2.6 -> v0.2.7 Updating log v0.4.17 -> v0.4.18 Updating mio v0.8.6 -> v0.8.8 Updating once_cell v1.17.1 -> v1.17.2 Updating pin-project v1.0.12 -> v1.1.0 Updating pin-project-internal v1.0.12 -> v1.1.0 Updating pkg-config v0.3.26 -> v0.3.27 Removing portable-atomic v0.3.19 Adding portable-atomic v0.3.20 Adding portable-atomic v1.3.3 Updating proc-macro2 v1.0.56 -> v1.0.59 Updating quote v1.0.26 -> v1.0.28 Updating regex v1.8.1 -> v1.8.3 Updating regex-syntax v0.7.1 -> v0.7.2 Updating rustls v0.21.0 -> v0.21.1 Updating serde v1.0.160 -> v1.0.163 Updating serde_derive v1.0.160 -> v1.0.163 Updating socket2 v0.5.2 -> v0.5.3 Updating subtle v2.4.1 -> v2.5.0 Updating syn v2.0.15 -> v2.0.18 Updating time v0.3.20 -> v0.3.21 Updating time-core v0.1.0 -> v0.1.1 Updating time-macros v0.2.8 -> v0.2.9 Updating tokio v1.28.0 -> v1.28.2 Updating tracing-core v0.1.30 -> v0.1.31 Updating unicode-ident v1.0.8 -> v1.0.9 Updating wasm-bindgen v0.2.84 -> v0.2.86 Updating wasm-bindgen-backend v0.2.84 -> v0.2.86 Updating wasm-bindgen-macro v0.2.84 -> v0.2.86 Updating wasm-bindgen-macro-support v0.2.84 -> v0.2.86 Updating wasm-bindgen-shared v0.2.84 -> v0.2.86 Updating web-sys v0.3.61 -> v0.3.63 --- Cargo.lock | 213 +++++++++++++++++++++++++++-------------------------- 1 file changed, 110 insertions(+), 103 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 0957ebe..6ffe71b 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -128,7 +128,7 @@ dependencies = [ "serde", "signal-hook", "slab", - "socket2 0.5.2", + "socket2 0.5.3", ] [[package]] @@ -223,7 +223,7 @@ dependencies = [ "serde", "signal-hook", "slab", - "socket2 0.5.2", + "socket2 0.5.3", "time", "tinytemplate", ] @@ -262,7 +262,7 @@ dependencies = [ "rand", "rand_distr", "serde", - "socket2 0.5.2", + "socket2 0.5.3", ] [[package]] @@ -304,7 +304,7 @@ dependencies = [ "serde", "signal-hook", "slab", - "socket2 0.5.2", + "socket2 0.5.3", "tungstenite", ] @@ -418,9 +418,9 @@ checksum = "9e1b586273c5702936fe7b7d6896644d8be71e6314cfe09d3167c95f712589e8" [[package]] name = "base64" -version = "0.21.0" +version = "0.21.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a4a4ddaa51a5bc52a6948f74c06d20aaaddb71924eab79b8c97a8c556e942d6a" +checksum = "604178f6c5c21f02dc555784810edfb88d34ac2c73b2eae109655649ee73ce3d" [[package]] name = "bendy" @@ -483,9 +483,9 @@ checksum = "3240a4cb09cf0da6a51641bd40ce90e96ea6065e3a1adc46434029254bcc2d09" [[package]] name = "bumpalo" -version = "3.12.1" +version = "3.13.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9b1ce199063694f33ffb7dd4e0ee620741495c32833cde5aa08f02a0bf96f0c8" +checksum = "a3e2c3daef883ecc1b5d58c15adae93470a91d425f3532ba1695849656af3fc1" [[package]] name = "byteorder" @@ -501,9 +501,9 @@ checksum = "89b2fd2a0dcf38d7971e2194b6b6eebab45ae01067456a7fd93d5547a61b70be" [[package]] name = "cache-padded" -version = "1.2.0" +version = "1.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c1db59621ec70f09c5e9b597b220c7a2b43611f4710dc03ceb8748637775692c" +checksum = "981520c98f422fcc584dc1a95c334e6953900b9106bc47a9839b81790009eb21" [[package]] name = "cast" @@ -534,9 +534,9 @@ checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" [[package]] name = "ciborium" -version = "0.2.0" +version = "0.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b0c137568cc60b904a7724001b35ce2630fd00d5d84805fbb608ab89509d788f" +checksum = "effd91f6c78e5a4ace8a5d3c0b6bfaec9e2baaef55f3efc00e45fb2e477ee926" dependencies = [ "ciborium-io", "ciborium-ll", @@ -545,15 +545,15 @@ dependencies = [ [[package]] name = "ciborium-io" -version = "0.2.0" +version = "0.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "346de753af073cc87b52b2083a506b38ac176a44cfb05497b622e27be899b369" +checksum = "cdf919175532b369853f5d5e20b26b43112613fd6fe7aee757e35f7a44642656" [[package]] name = "ciborium-ll" -version = "0.2.0" +version = "0.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "213030a2b5a4e0c0892b6652260cf6ccac84827b83a85a534e178e3906c4cf1b" +checksum = "defaa24ecc093c77630e6c15e17c51f5e187bf35ee514f4e2d67baaa96dae22b" dependencies = [ "ciborium-io", "half", @@ -616,15 +616,15 @@ dependencies = [ [[package]] name = "console" -version = "0.15.5" +version = "0.15.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c3d79fbe8970a77e3e34151cc13d3b3e248aa0faaecb9f6091fa07ebefe5ad60" +checksum = "c926e00cc70edefdc64d3a5ff31cc65bb97a3460097762bd23afb4d8145fccf8" dependencies = [ "encode_unicode", "lazy_static", "libc", "unicode-width", - "windows-sys 0.42.0", + "windows-sys 0.45.0", ] [[package]] @@ -766,9 +766,9 @@ dependencies = [ [[package]] name = "digest" -version = "0.10.6" +version = "0.10.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8168378f4e5023e7218c89c891c0fd8ecdb5e5e4f18cb78f38cf245dd021e76f" +checksum = "9ed9a281f7bc9b7576e61468ba615a66a5c8cfdff42420a70aa82701a3b1e292" dependencies = [ "block-buffer", "crypto-common", @@ -967,7 +967,7 @@ checksum = "89ca545a94061b6365f2c7355b4b32bd20df3ff95f02da9329b34ccc3bd6ee72" dependencies = [ "proc-macro2", "quote", - "syn 2.0.15", + "syn 2.0.18", ] [[package]] @@ -1270,13 +1270,14 @@ dependencies = [ [[package]] name = "indicatif" -version = "0.17.3" +version = "0.17.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cef509aa9bc73864d6756f0d34d35504af3cf0844373afe9b8669a5b8005a729" +checksum = "db45317f37ef454e6519b6c3ed7d377e5f23346f0823f86e65ca36912d1d0ef8" dependencies = [ "console", + "instant", "number_prefix", - "portable-atomic", + "portable-atomic 1.3.3", "unicode-width", ] @@ -1331,9 +1332,9 @@ checksum = "453ad9f582a441959e5f0d088b02ce04cfe8d51a8eaf077f12ac6d3e94164ca6" [[package]] name = "js-sys" -version = "0.3.61" +version = "0.3.63" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "445dde2150c55e483f3d8416706b97ec8e8237c307e5b7b4b8dd15e6af2a0730" +checksum = "2f37a4a5928311ac501dee68b3c7613a1037d0edb30c8e5427bd832d55d1b790" dependencies = [ "wasm-bindgen", ] @@ -1356,15 +1357,15 @@ checksum = "e2abad23fbc42b3700f2f279844dc832adb2b2eb069b2df918f455c4e18cc646" [[package]] name = "libc" -version = "0.2.142" +version = "0.2.144" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6a987beff54b60ffa6d51982e1aa1146bc42f19bd26be28b0586f252fccf5317" +checksum = "2b00cc1c228a6782d0f076e7b232802e0c5689d41bb5df366f2a6b6621cfdfe1" [[package]] name = "libm" -version = "0.2.6" +version = "0.2.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "348108ab3fba42ec82ff6e9564fc4ca0247bdccdc68dd8af9764bbc79c3c8ffb" +checksum = "f7012b1bbb0719e1097c47611d3898568c546d597c2e74d66f6087edd5233ff4" [[package]] name = "libmimalloc-sys" @@ -1397,12 +1398,9 @@ dependencies = [ [[package]] name = "log" -version = "0.4.17" +version = "0.4.18" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "abb12e687cfb44aa40f41fc3978ef76448f9b6038cad6aef4259d3c095a2382e" -dependencies = [ - "cfg-if", -] +checksum = "518ef76f2f87365916b142844c16d8fefd85039bc5699050210a7778ee1cd1de" [[package]] name = "mach" @@ -1454,7 +1452,7 @@ checksum = "7b9b8653cec6897f73b519a43fba5ee3d50f62fe9af80b428accdcc093b4a849" dependencies = [ "ahash 0.7.6", "metrics-macros", - "portable-atomic", + "portable-atomic 0.3.20", ] [[package]] @@ -1469,7 +1467,7 @@ dependencies = [ "metrics", "metrics-util", "parking_lot", - "portable-atomic", + "portable-atomic 0.3.20", "quanta", "thiserror", "tokio", @@ -1498,7 +1496,7 @@ dependencies = [ "metrics", "num_cpus", "parking_lot", - "portable-atomic", + "portable-atomic 0.3.20", "quanta", "sketches-ddsketch 0.2.1", ] @@ -1538,14 +1536,14 @@ dependencies = [ [[package]] name = "mio" -version = "0.8.6" +version = "0.8.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5b9d9a46eff5b4ff64b45a9e316a6d1e0bc719ef429cbec4dc630684212bfdf9" +checksum = "927a765cd3fc26206e66b296465fa9d3e5ab003e651c1b3c060e7956d96b19d2" dependencies = [ "libc", "log", "wasi 0.11.0+wasi-snapshot-preview1", - "windows-sys 0.45.0", + "windows-sys 0.48.0", ] [[package]] @@ -1688,9 +1686,9 @@ dependencies = [ [[package]] name = "once_cell" -version = "1.17.1" +version = "1.17.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b7e5500299e16ebb147ae15a00a942af264cf3688f47923b8fc2cd5858f23ad3" +checksum = "9670a07f94779e00908f3e686eab508878ebb390ba6e604d3a284c00e8d0487b" [[package]] name = "oorandom" @@ -1747,22 +1745,22 @@ checksum = "478c572c3d73181ff3c2539045f6eb99e5491218eae919370993b890cdbdd98e" [[package]] name = "pin-project" -version = "1.0.12" +version = "1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ad29a609b6bcd67fee905812e544992d216af9d755757c05ed2d0e15a74c6ecc" +checksum = "c95a7476719eab1e366eaf73d0260af3021184f18177925b07f54b30089ceead" dependencies = [ "pin-project-internal", ] [[package]] name = "pin-project-internal" -version = "1.0.12" +version = "1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "069bdb1e05adc7a8990dce9cc75370895fbe4e3d58b9b73bf1aee56359344a55" +checksum = "39407670928234ebc5e6e580247dd567ad73a3578460c5990f9503df207e8f07" dependencies = [ "proc-macro2", "quote", - "syn 1.0.109", + "syn 2.0.18", ] [[package]] @@ -1779,9 +1777,9 @@ checksum = "8b870d8c151b6f2fb93e84a13146138f05d02ed11c7e7c54f8826aaaf7c9f184" [[package]] name = "pkg-config" -version = "0.3.26" +version = "0.3.27" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6ac9a59f73473f1b8d852421e59e64809f025994837ef743615c6d0c5b305160" +checksum = "26072860ba924cbfa98ea39c8c19b4dd6a4a25423dbdf219c1eca91aa0cf6964" [[package]] name = "plotters" @@ -1813,9 +1811,18 @@ dependencies = [ [[package]] name = "portable-atomic" -version = "0.3.19" +version = "0.3.20" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "26f6a7b87c2e435a3241addceeeff740ff8b7e76b74c13bf9acb17fa454ea00b" +checksum = "e30165d31df606f5726b090ec7592c308a0eaf61721ff64c9a3018e344a8753e" +dependencies = [ + "portable-atomic 1.3.3", +] + +[[package]] +name = "portable-atomic" +version = "1.3.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "767eb9f07d4a5ebcb39bbf2d452058a93c011373abf6832e24194a1c3f004794" [[package]] name = "ppv-lite86" @@ -1859,9 +1866,9 @@ dependencies = [ [[package]] name = "proc-macro2" -version = "1.0.56" +version = "1.0.59" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2b63bdb0cd06f1f4dedf69b254734f9b45af66e4a031e42a7480257d9898b435" +checksum = "6aeca18b86b413c660b781aa319e4e2648a3e6f9eadc9b47e9038e6fe9f3451b" dependencies = [ "unicode-ident", ] @@ -1906,9 +1913,9 @@ dependencies = [ [[package]] name = "quote" -version = "1.0.26" +version = "1.0.28" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4424af4bf778aae2051a77b60283332f386554255d722233d09fbfc7e30da2fc" +checksum = "1b9ab9c7eadfd8df19006f1cf1a4aed13540ed5cbc047010ece5826e10825488" dependencies = [ "proc-macro2", ] @@ -1995,9 +2002,9 @@ dependencies = [ [[package]] name = "regex" -version = "1.8.1" +version = "1.8.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "af83e617f331cc6ae2da5443c602dfa5af81e517212d9d611a5b3ba1777b5370" +checksum = "81ca098a9821bd52d6b24fd8b10bd081f47d39c22778cafaa75a2857a62c6390" dependencies = [ "aho-corasick", "memchr", @@ -2006,9 +2013,9 @@ dependencies = [ [[package]] name = "regex-syntax" -version = "0.7.1" +version = "0.7.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a5996294f19bd3aae0453a862ad728f60e6600695733dd5df01da90c54363a3c" +checksum = "436b050e76ed2903236f032a59761c1eb99e1b0aead2c257922771dab1fc8c78" [[package]] name = "ring" @@ -2042,9 +2049,9 @@ checksum = "d626bb9dae77e28219937af045c257c28bfd3f69333c512553507f5f9798cb76" [[package]] name = "rustls" -version = "0.21.0" +version = "0.21.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "07180898a28ed6a7f7ba2311594308f595e3dd2e3c3812fa0a80a47b45f17e5d" +checksum = "c911ba11bc8433e811ce56fde130ccf32f5127cab0e0194e9c68c5a5b671791e" dependencies = [ "log", "ring", @@ -2058,7 +2065,7 @@ version = "1.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d194b56d58803a43635bdc398cd17e383d6f71f9182b9a192c127ca42494a59b" dependencies = [ - "base64 0.21.0", + "base64 0.21.2", ] [[package]] @@ -2116,9 +2123,9 @@ dependencies = [ [[package]] name = "serde" -version = "1.0.160" +version = "1.0.163" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bb2f3770c8bce3bcda7e149193a069a0f4365bda1fa5cd88e03bca26afc1216c" +checksum = "2113ab51b87a539ae008b5c6c02dc020ffa39afd2d83cffcb3f4eb2722cebec2" dependencies = [ "serde_derive", ] @@ -2144,13 +2151,13 @@ dependencies = [ [[package]] name = "serde_derive" -version = "1.0.160" +version = "1.0.163" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "291a097c63d8497e00160b166a967a4a79c64f3facdd01cbd7502231688d77df" +checksum = "8c805777e3930c8883389c602315a24224bcc738b63905ef87cd1420353ea93e" dependencies = [ "proc-macro2", "quote", - "syn 2.0.15", + "syn 2.0.18", ] [[package]] @@ -2287,9 +2294,9 @@ dependencies = [ [[package]] name = "socket2" -version = "0.5.2" +version = "0.5.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6d283f86695ae989d1e18440a943880967156325ba025f05049946bff47bcc2b" +checksum = "2538b18701741680e0322a2302176d3253a35388e2e62f172f64f4f16605f877" dependencies = [ "libc", "windows-sys 0.48.0", @@ -2318,9 +2325,9 @@ checksum = "a2eb9349b6444b326872e140eb1cf5e7c522154d69e7a0ffb0fb81c06b37543f" [[package]] name = "subtle" -version = "2.4.1" +version = "2.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6bdef32e8150c2a081110b42772ffe7d7c9032b606bc226c8260fd97e0976601" +checksum = "81cdd64d312baedb58e21336b31bc043b77e01cc99033ce76ef539f78e965ebc" [[package]] name = "syn" @@ -2335,9 +2342,9 @@ dependencies = [ [[package]] name = "syn" -version = "2.0.15" +version = "2.0.18" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a34fcf3e8b60f57e6a14301a2e916d323af98b0ea63c599441eec8558660c822" +checksum = "32d41677bcbe24c20c52e7c70b0d8db04134c5d1066bf98662e2871ad200ea3e" dependencies = [ "proc-macro2", "quote", @@ -2367,14 +2374,14 @@ checksum = "f9456a42c5b0d803c8cd86e73dd7cc9edd429499f37a3550d286d5e86720569f" dependencies = [ "proc-macro2", "quote", - "syn 2.0.15", + "syn 2.0.18", ] [[package]] name = "time" -version = "0.3.20" +version = "0.3.21" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cd0cbfecb4d19b5ea75bb31ad904eb5b9fa13f21079c3b92017ebdf4999a5890" +checksum = "8f3403384eaacbca9923fa06940178ac13e4edb725486d70e8e15881d0c836cc" dependencies = [ "itoa", "libc", @@ -2386,15 +2393,15 @@ dependencies = [ [[package]] name = "time-core" -version = "0.1.0" +version = "0.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2e153e1f1acaef8acc537e68b44906d2db6436e2b35ac2c6b42640fff91f00fd" +checksum = "7300fbefb4dadc1af235a9cef3737cea692a9d97e1b9cbcd4ebdae6f8868e6fb" [[package]] name = "time-macros" -version = "0.2.8" +version = "0.2.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fd80a657e71da814b8e5d60d3374fc6d35045062245d80224748ae522dd76f36" +checksum = "372950940a5f07bf38dbe211d7283c9e6d7327df53794992d293e534c733d09b" dependencies = [ "time-core", ] @@ -2426,9 +2433,9 @@ checksum = "1f3ccbac311fea05f86f61904b462b55fb3df8837a366dfc601a0161d0532f20" [[package]] name = "tokio" -version = "1.28.0" +version = "1.28.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c3c786bf8134e5a3a166db9b29ab8f48134739014a3eca7bc6bfa95d673b136f" +checksum = "94d7b1cfd2aa4011f2de74c2c4c63665e27a71006b0a192dcd2710272e73dfa2" dependencies = [ "autocfg", "libc", @@ -2473,14 +2480,14 @@ checksum = "0f57e3ca2a01450b1a921183a9c9cbfda207fd822cef4ccb00a65402cbba7a74" dependencies = [ "proc-macro2", "quote", - "syn 2.0.15", + "syn 2.0.18", ] [[package]] name = "tracing-core" -version = "0.1.30" +version = "0.1.31" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "24eb03ba0eab1fd845050058ce5e616558e8f8d8fca633e6b163fe25c797213a" +checksum = "0955b8137a1df6f1a2e9a37d8a6656291ff0297c1a97c24e0d8425fe2312f79a" dependencies = [ "once_cell", ] @@ -2524,9 +2531,9 @@ checksum = "92888ba5573ff080736b3648696b70cafad7d250551175acbaa4e0385b3e1460" [[package]] name = "unicode-ident" -version = "1.0.8" +version = "1.0.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e5464a87b239f13a63a501f2701565754bae92d243d4bb7eb12f6d57d2269bf4" +checksum = "b15811caf2415fb889178633e7724bad2509101cde276048e013b9def5e51fa0" [[package]] name = "unicode-normalization" @@ -2630,9 +2637,9 @@ checksum = "9c8d87e72b64a3b4db28d11ce29237c246188f4f51057d65a7eab63b7987e423" [[package]] name = "wasm-bindgen" -version = "0.2.84" +version = "0.2.86" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "31f8dcbc21f30d9b8f2ea926ecb58f6b91192c17e9d33594b3df58b2007ca53b" +checksum = "5bba0e8cb82ba49ff4e229459ff22a191bbe9a1cb3a341610c9c33efc27ddf73" dependencies = [ "cfg-if", "wasm-bindgen-macro", @@ -2640,24 +2647,24 @@ dependencies = [ [[package]] name = "wasm-bindgen-backend" -version = "0.2.84" +version = "0.2.86" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "95ce90fd5bcc06af55a641a86428ee4229e44e07033963a2290a8e241607ccb9" +checksum = "19b04bc93f9d6bdee709f6bd2118f57dd6679cf1176a1af464fca3ab0d66d8fb" dependencies = [ "bumpalo", "log", "once_cell", "proc-macro2", "quote", - "syn 1.0.109", + "syn 2.0.18", "wasm-bindgen-shared", ] [[package]] name = "wasm-bindgen-macro" -version = "0.2.84" +version = "0.2.86" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4c21f77c0bedc37fd5dc21f897894a5ca01e7bb159884559461862ae90c0b4c5" +checksum = "14d6b024f1a526bb0234f52840389927257beb670610081360e5a03c5df9c258" dependencies = [ "quote", "wasm-bindgen-macro-support", @@ -2665,28 +2672,28 @@ dependencies = [ [[package]] name = "wasm-bindgen-macro-support" -version = "0.2.84" +version = "0.2.86" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2aff81306fcac3c7515ad4e177f521b5c9a15f2b08f4e32d823066102f35a5f6" +checksum = "e128beba882dd1eb6200e1dc92ae6c5dbaa4311aa7bb211ca035779e5efc39f8" dependencies = [ "proc-macro2", "quote", - "syn 1.0.109", + "syn 2.0.18", "wasm-bindgen-backend", "wasm-bindgen-shared", ] [[package]] name = "wasm-bindgen-shared" -version = "0.2.84" +version = "0.2.86" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0046fef7e28c3804e5e38bfa31ea2a0f73905319b677e57ebe37e49358989b5d" +checksum = "ed9d5b4305409d1fc9482fee2d7f9bcbf24b3972bf59817ef757e23982242a93" [[package]] name = "web-sys" -version = "0.3.61" +version = "0.3.63" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e33b99f4b23ba3eec1a53ac264e35a755f00e966e0065077d6027c0f575b0b97" +checksum = "3bdd9ef4e984da1187bf8110c5cf5b845fbc87a23602cdf912386a76fcd3a7c2" dependencies = [ "js-sys", "wasm-bindgen", From 8734855c494de6f0efd55a9e42328efc924e62ae Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Joakim=20Frosteg=C3=A5rd?= Date: Sat, 3 Jun 2023 18:03:51 +0200 Subject: [PATCH 2/5] Upgrade metrics, metrics-exporter, tungstenite & async-tungstenite --- Cargo.lock | 115 ++++++++++---------------------- aquatic_http/Cargo.toml | 4 +- aquatic_udp/Cargo.toml | 4 +- aquatic_ws/Cargo.toml | 8 +-- aquatic_ws_load_test/Cargo.toml | 4 +- aquatic_ws_protocol/Cargo.toml | 2 +- 6 files changed, 45 insertions(+), 92 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 6ffe71b..7dcd105 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -367,9 +367,9 @@ checksum = "8da52d66c7071e2e3fa2a1e5c6d088fec47b593032b254f5e980de8ea54454d6" [[package]] name = "async-tungstenite" -version = "0.20.0" +version = "0.22.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1e0388bb7a400072bbb41ceb75d65c3baefb2ea99672fa22e85278452cd9b58b" +checksum = "ce01ac37fdc85f10a43c43bc582cbd566720357011578a935761075f898baf58" dependencies = [ "futures-io", "futures-util", @@ -764,6 +764,12 @@ dependencies = [ "typenum", ] +[[package]] +name = "data-encoding" +version = "2.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c2e66c9d817f1720209181c316d28635c050fa304f9c79e47a520882661b7308" + [[package]] name = "digest" version = "0.10.7" @@ -1029,7 +1035,7 @@ dependencies = [ "cfg-if", "js-sys", "libc", - "wasi 0.11.0+wasi-snapshot-preview1", + "wasi", "wasm-bindgen", ] @@ -1118,9 +1124,6 @@ name = "hashbrown" version = "0.12.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8a9ee70c43aaf417c914396645a0fa852624801b24ebb7ae78fe8272889ac888" -dependencies = [ - "ahash 0.7.6", -] [[package]] name = "hashbrown" @@ -1277,7 +1280,7 @@ dependencies = [ "console", "instant", "number_prefix", - "portable-atomic 1.3.3", + "portable-atomic", "unicode-width", ] @@ -1403,10 +1406,10 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "518ef76f2f87365916b142844c16d8fefd85039bc5699050210a7778ee1cd1de" [[package]] -name = "mach" -version = "0.3.2" +name = "mach2" +version = "0.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b823e83b2affd8f40a9ee8c29dbc56404c1e34cd2710921f2801e2cf29527afa" +checksum = "6d0d1830bcd151a6fc4aea1369af235b36c1528fe976b8ff678683c9995eade8" dependencies = [ "libc", ] @@ -1446,28 +1449,27 @@ dependencies = [ [[package]] name = "metrics" -version = "0.20.1" +version = "0.21.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7b9b8653cec6897f73b519a43fba5ee3d50f62fe9af80b428accdcc093b4a849" +checksum = "aa8ebbd1a9e57bbab77b9facae7f5136aea44c356943bf9a198f647da64285d6" dependencies = [ - "ahash 0.7.6", + "ahash 0.8.3", "metrics-macros", - "portable-atomic 0.3.20", + "portable-atomic", ] [[package]] name = "metrics-exporter-prometheus" -version = "0.11.0" +version = "0.12.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8603921e1f54ef386189335f288441af761e0fc61bcb552168d9cedfe63ebc70" +checksum = "8a4964177ddfdab1e3a2b37aec7cf320e14169abb0ed73999f558136409178d5" dependencies = [ + "base64 0.21.2", "hyper", "indexmap", "ipnet", "metrics", "metrics-util", - "parking_lot", - "portable-atomic 0.3.20", "quanta", "thiserror", "tokio", @@ -1475,28 +1477,26 @@ dependencies = [ [[package]] name = "metrics-macros" -version = "0.6.0" +version = "0.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "731f8ecebd9f3a4aa847dfe75455e4757a45da40a7793d2f0b1f9b6ed18b23f3" +checksum = "ddece26afd34c31585c74a4db0630c376df271c285d682d1e55012197830b6df" dependencies = [ "proc-macro2", "quote", - "syn 1.0.109", + "syn 2.0.18", ] [[package]] name = "metrics-util" -version = "0.14.0" +version = "0.15.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f7d24dc2dbae22bff6f1f9326ffce828c9f07ef9cc1e8002e5279f845432a30a" +checksum = "111cb375987443c3de8d503580b536f77dc8416d32db62d9456db5d93bd7ac47" dependencies = [ "crossbeam-epoch", "crossbeam-utils", - "hashbrown 0.12.3", + "hashbrown 0.13.2", "metrics", "num_cpus", - "parking_lot", - "portable-atomic 0.3.20", "quanta", "sketches-ddsketch 0.2.1", ] @@ -1542,7 +1542,7 @@ checksum = "927a765cd3fc26206e66b296465fa9d3e5ab003e651c1b3c060e7956d96b19d2" dependencies = [ "libc", "log", - "wasi 0.11.0+wasi-snapshot-preview1", + "wasi", "windows-sys 0.48.0", ] @@ -1714,29 +1714,6 @@ version = "2.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "14f2252c834a40ed9bb5422029649578e63aa341ac401f74e719dd1afda8394e" -[[package]] -name = "parking_lot" -version = "0.12.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3742b2c103b9f06bc9fff0a37ff4912935851bee6d36f3c02bcc755bcfec228f" -dependencies = [ - "lock_api", - "parking_lot_core", -] - -[[package]] -name = "parking_lot_core" -version = "0.9.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9069cbb9f99e3a5083476ccb29ceb1de18b9118cafa53e90c9551235de2b9521" -dependencies = [ - "cfg-if", - "libc", - "redox_syscall", - "smallvec", - "windows-sys 0.45.0", -] - [[package]] name = "percent-encoding" version = "2.2.0" @@ -1809,15 +1786,6 @@ dependencies = [ "plotters-backend", ] -[[package]] -name = "portable-atomic" -version = "0.3.20" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e30165d31df606f5726b090ec7592c308a0eaf61721ff64c9a3018e344a8753e" -dependencies = [ - "portable-atomic 1.3.3", -] - [[package]] name = "portable-atomic" version = "1.3.3" @@ -1875,16 +1843,16 @@ dependencies = [ [[package]] name = "quanta" -version = "0.10.1" +version = "0.11.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b7e31331286705f455e56cca62e0e717158474ff02b7936c1fa596d983f4ae27" +checksum = "a17e662a7a8291a865152364c20c7abc5e60486ab2001e8ec10b24862de0b9ab" dependencies = [ "crossbeam-utils", "libc", - "mach", + "mach2", "once_cell", "raw-cpuid", - "wasi 0.10.2+wasi-snapshot-preview1", + "wasi", "web-sys", "winapi 0.3.9", ] @@ -1991,15 +1959,6 @@ dependencies = [ "num_cpus", ] -[[package]] -name = "redox_syscall" -version = "0.2.16" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fb5a58c1855b4b6819d59012155603f0b22ad30cad752600aadfcb695265519a" -dependencies = [ - "bitflags 1.3.2", -] - [[package]] name = "regex" version = "1.8.3" @@ -2500,13 +2459,13 @@ checksum = "3528ecfd12c466c6f163363caf2d02a71161dd5e1cc6ae7b34207ea2d42d81ed" [[package]] name = "tungstenite" -version = "0.18.0" +version = "0.19.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "30ee6ab729cd4cf0fd55218530c4522ed30b7b6081752839b68fcec8d0960788" +checksum = "15fba1a6d6bb030745759a9a2a588bfe8490fc8b4751a277db3a0be1c9ebbf67" dependencies = [ - "base64 0.13.1", "byteorder", "bytes", + "data-encoding", "http", "httparse", "log", @@ -2623,12 +2582,6 @@ dependencies = [ "try-lock", ] -[[package]] -name = "wasi" -version = "0.10.2+wasi-snapshot-preview1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fd6fbd9a79829dd1ad0cc20627bf1ed606756a7f77edff7b66b7064f9cb327c6" - [[package]] name = "wasi" version = "0.11.0+wasi-snapshot-preview1" diff --git a/aquatic_http/Cargo.toml b/aquatic_http/Cargo.toml index c7bb677..bcb1a52 100644 --- a/aquatic_http/Cargo.toml +++ b/aquatic_http/Cargo.toml @@ -36,8 +36,8 @@ glommio = "0.8" itoa = "1" libc = "0.2" log = "0.4" -metrics = { version = "0.20", optional = true } -metrics-exporter-prometheus = { version = "0.11", optional = true, default-features = false, features = ["http-listener"] } +metrics = { version = "0.21", optional = true } +metrics-exporter-prometheus = { version = "0.12", optional = true, default-features = false, features = ["http-listener"] } mimalloc = { version = "0.1", default-features = false } memchr = "2" privdrop = "0.5" diff --git a/aquatic_udp/Cargo.toml b/aquatic_udp/Cargo.toml index 4919209..88bc11b 100644 --- a/aquatic_udp/Cargo.toml +++ b/aquatic_udp/Cargo.toml @@ -39,8 +39,8 @@ hex = "0.4" io-uring = { version = "0.6", optional = true } libc = "0.2" log = "0.4" -metrics = { version = "0.20", optional = true } -metrics-exporter-prometheus = { version = "0.11", optional = true, default-features = false, features = ["http-listener"] } +metrics = { version = "0.21", optional = true } +metrics-exporter-prometheus = { version = "0.12", optional = true, default-features = false, features = ["http-listener"] } mimalloc = { version = "0.1", default-features = false } mio = { version = "0.8", features = ["net", "os-poll"] } num-format = "0.4" diff --git a/aquatic_ws/Cargo.toml b/aquatic_ws/Cargo.toml index 8d1bddc..7a65872 100644 --- a/aquatic_ws/Cargo.toml +++ b/aquatic_ws/Cargo.toml @@ -27,7 +27,7 @@ aquatic_toml_config.workspace = true aquatic_ws_protocol.workspace = true anyhow = "1" -async-tungstenite = "0.20" +async-tungstenite = "0.22" cfg-if = "1" futures = "0.3" futures-lite = "1" @@ -36,8 +36,8 @@ glommio = "0.8" hashbrown = { version = "0.13", features = ["serde"] } httparse = "1" log = "0.4" -metrics = { version = "0.20", optional = true } -metrics-exporter-prometheus = { version = "0.11", optional = true, default-features = false, features = ["http-listener"] } +metrics = { version = "0.21", optional = true } +metrics-exporter-prometheus = { version = "0.12", optional = true, default-features = false, features = ["http-listener"] } mimalloc = { version = "0.1", default-features = false } privdrop = "0.5" rand = { version = "0.8", features = ["small_rng"] } @@ -47,7 +47,7 @@ serde = { version = "1", features = ["derive"] } signal-hook = { version = "0.3" } slab = "0.4" socket2 = { version = "0.5", features = ["all"] } -tungstenite = "0.18" +tungstenite = "0.19" [dev-dependencies] quickcheck = "1" diff --git a/aquatic_ws_load_test/Cargo.toml b/aquatic_ws_load_test/Cargo.toml index d6dae34..e5c26d2 100644 --- a/aquatic_ws_load_test/Cargo.toml +++ b/aquatic_ws_load_test/Cargo.toml @@ -19,7 +19,7 @@ aquatic_toml_config.workspace = true aquatic_ws_protocol.workspace = true anyhow = "1" -async-tungstenite = "0.20" +async-tungstenite = "0.22" futures = "0.3" futures-rustls = "0.24" glommio = "0.8" @@ -30,7 +30,7 @@ rand_distr = "0.4" rustls = { version = "0.21", default-features = false, features = ["dangerous_configuration"] } serde = { version = "1", features = ["derive"] } serde_json = "1" -tungstenite = "0.18" +tungstenite = "0.19" [dev-dependencies] quickcheck = "1" diff --git a/aquatic_ws_protocol/Cargo.toml b/aquatic_ws_protocol/Cargo.toml index faeec1e..9a624d8 100644 --- a/aquatic_ws_protocol/Cargo.toml +++ b/aquatic_ws_protocol/Cargo.toml @@ -27,7 +27,7 @@ serde_json = "1" # simd-json version 0.7 seems to have bugs in string parsing # with custom visitor, where it includes quotes in strings simd-json = { version = "0.6", features = ["allow-non-simd"] } -tungstenite = "0.18" +tungstenite = "0.19" [dev-dependencies] criterion = "0.4" From fca6cc9fbd3db9f19c85255eb1bf52ce7d420ee7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Joakim=20Frosteg=C3=A5rd?= Date: Sat, 3 Jun 2023 18:27:54 +0200 Subject: [PATCH 3/5] ws: update simd-json to 0.10.3 --- Cargo.lock | 77 +++++++++++++++++++++++-- aquatic_ws_protocol/Cargo.toml | 2 +- aquatic_ws_protocol/src/common.rs | 41 ++++++++----- aquatic_ws_protocol/src/lib.rs | 71 +++++++++++++---------- aquatic_ws_protocol/src/request/mod.rs | 6 +- aquatic_ws_protocol/src/response/mod.rs | 8 +-- 6 files changed, 145 insertions(+), 60 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 7dcd105..501dcf8 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1111,9 +1111,9 @@ checksum = "eabb4a44450da02c90444cf74558da904edde8fb4e9035a9a6a4e15445af0bd7" [[package]] name = "halfbrown" -version = "0.1.18" +version = "0.2.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9e2a3c70a9c00cc1ee87b54e89f9505f73bb17d63f1b25c9a462ba8ef885444f" +checksum = "f985624e90f861184145c13b736873a0f83cdb998a292dbb0653598ab03aecbf" dependencies = [ "hashbrown 0.13.2", "serde", @@ -1358,6 +1358,70 @@ version = "1.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e2abad23fbc42b3700f2f279844dc832adb2b2eb069b2df918f455c4e18cc646" +[[package]] +name = "lexical-core" +version = "0.8.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2cde5de06e8d4c2faabc400238f9ae1c74d5412d03a7bd067645ccbc47070e46" +dependencies = [ + "lexical-parse-float", + "lexical-parse-integer", + "lexical-util", + "lexical-write-float", + "lexical-write-integer", +] + +[[package]] +name = "lexical-parse-float" +version = "0.8.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "683b3a5ebd0130b8fb52ba0bdc718cc56815b6a097e28ae5a6997d0ad17dc05f" +dependencies = [ + "lexical-parse-integer", + "lexical-util", + "static_assertions", +] + +[[package]] +name = "lexical-parse-integer" +version = "0.8.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6d0994485ed0c312f6d965766754ea177d07f9c00c9b82a5ee62ed5b47945ee9" +dependencies = [ + "lexical-util", + "static_assertions", +] + +[[package]] +name = "lexical-util" +version = "0.8.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5255b9ff16ff898710eb9eb63cb39248ea8a5bb036bea8085b1a767ff6c4e3fc" +dependencies = [ + "static_assertions", +] + +[[package]] +name = "lexical-write-float" +version = "0.8.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "accabaa1c4581f05a3923d1b4cfd124c329352288b7b9da09e766b0668116862" +dependencies = [ + "lexical-util", + "lexical-write-integer", + "static_assertions", +] + +[[package]] +name = "lexical-write-integer" +version = "0.8.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e1b6f3d1f4422866b68192d62f77bc5c700bee84f3069f2469d7bc8c77852446" +dependencies = [ + "lexical-util", + "static_assertions", +] + [[package]] name = "libc" version = "0.2.144" @@ -2162,11 +2226,12 @@ dependencies = [ [[package]] name = "simd-json" -version = "0.6.0" +version = "0.10.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9bd78b840b9de64fa3f7d72909b76343849f68e8c3d32608db8d38e4e5481f84" +checksum = "a3d0815e7ff0f1f05e09d4b029f86d8a330f0ab15b35b28736f3758325f59e14" dependencies = [ "halfbrown", + "lexical-core", "serde", "serde_json", "simdutf8", @@ -2540,9 +2605,9 @@ checksum = "09cc8ee72d2a9becf2f2febe0205bbed8fc6615b7cb429ad062dc7b7ddd036a9" [[package]] name = "value-trait" -version = "0.4.0" +version = "0.6.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c0a635407649b66e125e4d2ffd208153210179f8c7c8b71c030aa2ad3eeb4c8f" +checksum = "09a5b6c8ceb01263b969cac48d4a6705134d490ded13d889e52c0cfc80c6945e" dependencies = [ "float-cmp", "halfbrown", diff --git a/aquatic_ws_protocol/Cargo.toml b/aquatic_ws_protocol/Cargo.toml index 9a624d8..4868de0 100644 --- a/aquatic_ws_protocol/Cargo.toml +++ b/aquatic_ws_protocol/Cargo.toml @@ -26,7 +26,7 @@ serde = { version = "1", features = ["derive"] } serde_json = "1" # simd-json version 0.7 seems to have bugs in string parsing # with custom visitor, where it includes quotes in strings -simd-json = { version = "0.6", features = ["allow-non-simd"] } +simd-json = { version = "0.10", features = ["allow-non-simd"] } tungstenite = "0.19" [dev-dependencies] diff --git a/aquatic_ws_protocol/src/common.rs b/aquatic_ws_protocol/src/common.rs index 93565af..a1fdb1e 100644 --- a/aquatic_ws_protocol/src/common.rs +++ b/aquatic_ws_protocol/src/common.rs @@ -202,39 +202,50 @@ mod tests { #[test] fn test_deserialize_20_bytes() { - let mut input = r#""aaaabbbbccccddddeeee""#.to_string(); + unsafe { + let mut input = r#""aaaabbbbccccddddeeee""#.to_string(); - let expected = info_hash_from_bytes(b"aaaabbbbccccddddeeee"); - let observed: InfoHash = ::simd_json::serde::from_str(&mut input).unwrap(); + let expected = info_hash_from_bytes(b"aaaabbbbccccddddeeee"); + let observed: InfoHash = ::simd_json::serde::from_str(&mut input).unwrap(); - assert_eq!(observed, expected); + assert_eq!(observed, expected); + } - let mut input = r#""aaaabbbbccccddddeee""#.to_string(); - let res_info_hash: Result = ::simd_json::serde::from_str(&mut input); + unsafe { + let mut input = r#""aaaabbbbccccddddeee""#.to_string(); + let res_info_hash: Result = ::simd_json::serde::from_str(&mut input); - assert!(res_info_hash.is_err()); + assert!(res_info_hash.is_err()); + } - let mut input = r#""aaaabbbbccccddddeeeš•Š""#.to_string(); - let res_info_hash: Result = ::simd_json::serde::from_str(&mut input); + unsafe { + let mut input = r#""aaaabbbbccccddddeeeš•Š""#.to_string(); + let res_info_hash: Result = ::simd_json::serde::from_str(&mut input); - assert!(res_info_hash.is_err()); + assert!(res_info_hash.is_err()); + } } #[test] fn test_serde_20_bytes() { let info_hash = info_hash_from_bytes(b"aaaabbbbccccddddeeee"); - let mut out = ::simd_json::serde::to_string(&info_hash).unwrap(); - let info_hash_2 = ::simd_json::serde::from_str(&mut out).unwrap(); + let info_hash_2 = unsafe { + let mut out = ::simd_json::serde::to_string(&info_hash).unwrap(); + + ::simd_json::serde::from_str(&mut out).unwrap() + }; assert_eq!(info_hash, info_hash_2); } #[quickcheck] fn quickcheck_serde_20_bytes(info_hash: InfoHash) -> bool { - let mut out = ::simd_json::serde::to_string(&info_hash).unwrap(); - let info_hash_2 = ::simd_json::serde::from_str(&mut out).unwrap(); + unsafe { + let mut out = ::simd_json::serde::to_string(&info_hash).unwrap(); + let info_hash_2 = ::simd_json::serde::from_str(&mut out).unwrap(); - info_hash == info_hash_2 + info_hash == info_hash_2 + } } } diff --git a/aquatic_ws_protocol/src/lib.rs b/aquatic_ws_protocol/src/lib.rs index e2971f7..5772307 100644 --- a/aquatic_ws_protocol/src/lib.rs +++ b/aquatic_ws_protocol/src/lib.rs @@ -262,12 +262,6 @@ mod tests { #[test] fn test_deserialize_info_hashes_vec() { - let mut input: String = r#"{ - "action": "scrape", - "info_hash": ["aaaabbbbccccddddeeee", "aaaabbbbccccddddeeee"] - }"# - .into(); - let info_hashes = ScrapeRequestInfoHashes::Multiple(vec![ info_hash_from_bytes(b"aaaabbbbccccddddeeee"), info_hash_from_bytes(b"aaaabbbbccccddddeeee"), @@ -278,19 +272,21 @@ mod tests { info_hashes: Some(info_hashes), }; - let observed: ScrapeRequest = ::simd_json::serde::from_str(&mut input).unwrap(); + let observed: ScrapeRequest = unsafe { + let mut input: String = r#"{ + "action": "scrape", + "info_hash": ["aaaabbbbccccddddeeee", "aaaabbbbccccddddeeee"] + }"# + .into(); + + ::simd_json::serde::from_str(&mut input).unwrap() + }; assert_eq!(expected, observed); } #[test] fn test_deserialize_info_hashes_str() { - let mut input: String = r#"{ - "action": "scrape", - "info_hash": "aaaabbbbccccddddeeee" - }"# - .into(); - let info_hashes = ScrapeRequestInfoHashes::Single(info_hash_from_bytes(b"aaaabbbbccccddddeeee")); @@ -299,54 +295,65 @@ mod tests { info_hashes: Some(info_hashes), }; - let observed: ScrapeRequest = ::simd_json::serde::from_str(&mut input).unwrap(); + let observed: ScrapeRequest = unsafe { + let mut input: String = r#"{ + "action": "scrape", + "info_hash": "aaaabbbbccccddddeeee" + }"# + .into(); + + ::simd_json::serde::from_str(&mut input).unwrap() + }; assert_eq!(expected, observed); } #[test] fn test_deserialize_info_hashes_null() { - let mut input: String = r#"{ - "action": "scrape", - "info_hash": null - }"# - .into(); + let observed: ScrapeRequest = unsafe { + let mut input: String = r#"{ + "action": "scrape", + "info_hash": null + }"# + .into(); + + ::simd_json::serde::from_str(&mut input).unwrap() + }; let expected = ScrapeRequest { action: ScrapeAction, info_hashes: None, }; - let observed: ScrapeRequest = ::simd_json::serde::from_str(&mut input).unwrap(); - assert_eq!(expected, observed); } #[test] fn test_deserialize_info_hashes_missing() { - let mut input: String = r#"{ - "action": "scrape" - }"# - .into(); + let observed: ScrapeRequest = unsafe { + let mut input: String = r#"{ + "action": "scrape" + }"# + .into(); + + ::simd_json::serde::from_str(&mut input).unwrap() + }; let expected = ScrapeRequest { action: ScrapeAction, info_hashes: None, }; - let observed: ScrapeRequest = ::simd_json::serde::from_str(&mut input).unwrap(); - assert_eq!(expected, observed); } #[quickcheck] fn quickcheck_serde_identity_info_hashes(info_hashes: ScrapeRequestInfoHashes) -> bool { - let mut json = ::simd_json::serde::to_string(&info_hashes).unwrap(); + let deserialized: ScrapeRequestInfoHashes = unsafe { + let mut json = ::simd_json::serde::to_string(&info_hashes).unwrap(); - println!("{}", json); - - let deserialized: ScrapeRequestInfoHashes = - ::simd_json::serde::from_str(&mut json).unwrap(); + ::simd_json::serde::from_str(&mut json).unwrap() + }; let success = info_hashes == deserialized; diff --git a/aquatic_ws_protocol/src/request/mod.rs b/aquatic_ws_protocol/src/request/mod.rs index 853804b..1fe48a3 100644 --- a/aquatic_ws_protocol/src/request/mod.rs +++ b/aquatic_ws_protocol/src/request/mod.rs @@ -26,8 +26,10 @@ impl InMessage { use tungstenite::Message; match ws_message { - Message::Text(mut text) => { - ::simd_json::serde::from_str(&mut text).context("deserialize with serde") + Message::Text(text) => { + let mut text: Vec = text.into(); + + ::simd_json::serde::from_slice(&mut text).context("deserialize with serde") } Message::Binary(mut bytes) => { ::simd_json::serde::from_slice(&mut bytes[..]).context("deserialize with serde") diff --git a/aquatic_ws_protocol/src/response/mod.rs b/aquatic_ws_protocol/src/response/mod.rs index 363eeae..8885221 100644 --- a/aquatic_ws_protocol/src/response/mod.rs +++ b/aquatic_ws_protocol/src/response/mod.rs @@ -33,12 +33,12 @@ impl OutMessage { pub fn from_ws_message(message: ::tungstenite::Message) -> ::anyhow::Result { use tungstenite::Message::{Binary, Text}; - let mut text = match message { - Text(text) => text, - Binary(bytes) => String::from_utf8(bytes)?, + let mut text: Vec = match message { + Text(text) => text.into(), + Binary(bytes) => String::from_utf8(bytes)?.into(), _ => return Err(anyhow::anyhow!("Message is neither text nor bytes")), }; - Ok(::simd_json::serde::from_str(&mut text)?) + Ok(::simd_json::serde::from_slice(&mut text)?) } } From 4e5fb8a8481ff79021b9f5b58413af3da4fa135e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Joakim=20Frosteg=C3=A5rd?= Date: Sat, 3 Jun 2023 18:33:01 +0200 Subject: [PATCH 4/5] ws protocol: remove a Cargo.toml comment --- aquatic_ws_protocol/Cargo.toml | 2 -- 1 file changed, 2 deletions(-) diff --git a/aquatic_ws_protocol/Cargo.toml b/aquatic_ws_protocol/Cargo.toml index 4868de0..68d8d09 100644 --- a/aquatic_ws_protocol/Cargo.toml +++ b/aquatic_ws_protocol/Cargo.toml @@ -24,8 +24,6 @@ anyhow = "1" hashbrown = { version = "0.13", features = ["serde"] } serde = { version = "1", features = ["derive"] } serde_json = "1" -# simd-json version 0.7 seems to have bugs in string parsing -# with custom visitor, where it includes quotes in strings simd-json = { version = "0.10", features = ["allow-non-simd"] } tungstenite = "0.19" From abf4c9f528fb58fb7472d4e5b6e00f042e790dc7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Joakim=20Frosteg=C3=A5rd?= Date: Sat, 3 Jun 2023 18:37:00 +0200 Subject: [PATCH 5/5] ws protocol: update criterion --- Cargo.lock | 128 +++++++++++++++++++++++++++++++-- aquatic_ws_protocol/Cargo.toml | 2 +- 2 files changed, 124 insertions(+), 6 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 501dcf8..20f3262 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -55,6 +55,12 @@ version = "0.1.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4b46cbb362ab8752921c97e041f5e366ee6297bd428a31275b9fcf1e380f7299" +[[package]] +name = "anstyle" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "41ed9a86bf92ae6580e0a31281f65a1b1d867c0cc68d5346e2ae128dddfa6a7d" + [[package]] name = "anyhow" version = "1.0.71" @@ -160,7 +166,7 @@ dependencies = [ "anyhow", "bendy", "compact_str", - "criterion", + "criterion 0.4.0", "hex", "httparse", "itoa", @@ -337,7 +343,7 @@ name = "aquatic_ws_protocol" version = "0.8.0" dependencies = [ "anyhow", - "criterion", + "criterion 0.5.1", "hashbrown 0.13.2", "quickcheck", "quickcheck_macros", @@ -566,11 +572,31 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4ea181bf566f71cb9a5d17a59e1871af638180a18fb0035c92ae62b705207123" dependencies = [ "bitflags 1.3.2", - "clap_lex", + "clap_lex 0.2.4", "indexmap", "textwrap", ] +[[package]] +name = "clap" +version = "4.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b4ed2379f8603fa2b7509891660e802b88c70a79a6427a70abb5968054de2c28" +dependencies = [ + "clap_builder", +] + +[[package]] +name = "clap_builder" +version = "4.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "72394f3339a76daf211e57d4bcb374410f3965dcc606dd0e03738c7888766980" +dependencies = [ + "anstyle", + "bitflags 1.3.2", + "clap_lex 0.5.0", +] + [[package]] name = "clap_lex" version = "0.2.4" @@ -580,6 +606,12 @@ dependencies = [ "os_str_bytes", ] +[[package]] +name = "clap_lex" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2da6da31387c7e4ef160ffab6d5e7f00c42626fe39aea70a7b0f1773f7dd6c1b" + [[package]] name = "colored" version = "2.0.0" @@ -661,7 +693,7 @@ dependencies = [ "atty", "cast", "ciborium", - "clap", + "clap 3.2.25", "criterion-plot", "itertools", "lazy_static", @@ -677,6 +709,32 @@ dependencies = [ "walkdir", ] +[[package]] +name = "criterion" +version = "0.5.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f2b12d017a929603d80db1831cd3a24082f8137ce19c69e6447f54f5fc8d692f" +dependencies = [ + "anes", + "cast", + "ciborium", + "clap 4.3.1", + "criterion-plot", + "is-terminal", + "itertools", + "num-traits", + "once_cell", + "oorandom", + "plotters", + "rayon", + "regex", + "serde", + "serde_derive", + "serde_json", + "tinytemplate", + "walkdir", +] + [[package]] name = "criterion-plot" version = "0.5.0" @@ -836,6 +894,17 @@ dependencies = [ "winapi 0.3.9", ] +[[package]] +name = "errno" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4bcfec3a70f97c962c307b2d2c56e358cf1d00b558d74262b5f929ee8cc7e73a" +dependencies = [ + "errno-dragonfly", + "libc", + "windows-sys 0.48.0", +] + [[package]] name = "errno-dragonfly" version = "0.1.2" @@ -1173,6 +1242,12 @@ dependencies = [ "libc", ] +[[package]] +name = "hermit-abi" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fed44880c466736ef9a5c5b5facefb5ed0785676d0c02d612db14e54f0d84286" + [[package]] name = "hex" version = "0.4.3" @@ -1220,7 +1295,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2934f84993b8b4bcae9b6a4e5f0aca638462dda9c7b4f26a570241494f21e0f4" dependencies = [ "bitflags 0.7.0", - "errno", + "errno 0.2.8", "kernel32-sys", "libc", "num", @@ -1302,6 +1377,17 @@ dependencies = [ "memoffset 0.8.0", ] +[[package]] +name = "io-lifetimes" +version = "1.0.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "eae7b9aee968036d54dce06cebaefd919e4472e753296daccd6d344e3e2df0c2" +dependencies = [ + "hermit-abi 0.3.1", + "libc", + "windows-sys 0.48.0", +] + [[package]] name = "io-uring" version = "0.6.0" @@ -1318,6 +1404,18 @@ version = "2.7.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "12b6ee2129af8d4fb011108c73d99a1b83a85977f23b82460c0ae2e25bb4b57f" +[[package]] +name = "is-terminal" +version = "0.4.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "adcf93614601c8129ddf72e2d5633df827ba6551541c6d8c59520a371475be1f" +dependencies = [ + "hermit-abi 0.3.1", + "io-lifetimes", + "rustix", + "windows-sys 0.48.0", +] + [[package]] name = "itertools" version = "0.10.5" @@ -1444,6 +1542,12 @@ dependencies = [ "libc", ] +[[package]] +name = "linux-raw-sys" +version = "0.3.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ef53942eb7bf7ff43a617b3e2c1c4a5ecf5944a7c1bc12d7ee39bbb15e5c1519" + [[package]] name = "lock_api" version = "0.4.9" @@ -2070,6 +2174,20 @@ version = "0.1.23" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d626bb9dae77e28219937af045c257c28bfd3f69333c512553507f5f9798cb76" +[[package]] +name = "rustix" +version = "0.37.19" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "acf8729d8542766f1b2cf77eb034d52f40d375bb8b615d0b147089946e16613d" +dependencies = [ + "bitflags 1.3.2", + "errno 0.3.1", + "io-lifetimes", + "libc", + "linux-raw-sys", + "windows-sys 0.48.0", +] + [[package]] name = "rustls" version = "0.21.1" diff --git a/aquatic_ws_protocol/Cargo.toml b/aquatic_ws_protocol/Cargo.toml index 68d8d09..0abe6b0 100644 --- a/aquatic_ws_protocol/Cargo.toml +++ b/aquatic_ws_protocol/Cargo.toml @@ -28,6 +28,6 @@ simd-json = { version = "0.10", features = ["allow-non-simd"] } tungstenite = "0.19" [dev-dependencies] -criterion = "0.4" +criterion = "0.5" quickcheck = "1" quickcheck_macros = "1"