From d1a6fb29718535b8d528bb8ac4a87e270bb2e2a2 Mon Sep 17 00:00:00 2001 From: Tamo Date: Mon, 17 Oct 2022 18:57:23 +0200 Subject: [PATCH] bump enum-iter and fix a bunch of error messages --- Cargo.lock | 394 ++++++++++++++++++--------------- meilisearch-auth/Cargo.toml | 2 +- meilisearch-auth/src/error.rs | 2 +- meilisearch-auth/src/store.rs | 1 - meilisearch-types/Cargo.toml | 2 +- meilisearch-types/src/keys.rs | 4 +- meilisearch-types/src/tasks.rs | 82 ++++--- 7 files changed, 275 insertions(+), 212 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index d1f6b290a..5f8cce6a1 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -59,7 +59,7 @@ dependencies = [ "http", "httparse", "httpdate", - "itoa 1.0.3", + "itoa 1.0.4", "language-tags", "local-channel", "mime", @@ -78,7 +78,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "465a6172cf69b960917811022d8f29bc0b7fa1398bc4f78b3c466673db1213b6" dependencies = [ "quote 1.0.21", - "syn 1.0.101", + "syn 1.0.102", ] [[package]] @@ -188,7 +188,7 @@ dependencies = [ "futures-core", "futures-util", "http", - "itoa 1.0.3", + "itoa 1.0.4", "language-tags", "log", "mime", @@ -211,9 +211,9 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1fa9362663c8643d67b2d5eafba49e4cb2c8a053a29ed00a0bea121f17c76b13" dependencies = [ "actix-router", - "proc-macro2 1.0.46", + "proc-macro2 1.0.47", "quote 1.0.21", - "syn 1.0.101", + "syn 1.0.102", ] [[package]] @@ -330,20 +330,20 @@ version = "0.3.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "10f203db73a71dfa2fb6dd22763990fa26f3d2625a6da2da900d23b87d26be27" dependencies = [ - "proc-macro2 1.0.46", + "proc-macro2 1.0.47", "quote 1.0.21", - "syn 1.0.101", + "syn 1.0.102", ] [[package]] name = "async-trait" -version = "0.1.57" +version = "0.1.58" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "76464446b8bc32758d7e88ee1a804d9914cd9b1cb264c029899680b0be29826f" +checksum = "1e805d94e6b5001b651426cf4cd446b1ab5f319d27bab5c644f61de0a804360c" dependencies = [ - "proc-macro2 1.0.46", + "proc-macro2 1.0.47", "quote 1.0.21", - "syn 1.0.101", + "syn 1.0.102", ] [[package]] @@ -410,9 +410,9 @@ checksum = "904dfeac50f3cdaba28fc6f57fdcddb75f49ed61346676a78c4ffe55877802fd" [[package]] name = "base64ct" -version = "1.0.1" +version = "1.5.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8a32fd6af2b5827bce66c29053ba0e7c42b9dcab01835835058558c10851a46b" +checksum = "b645a089122eccb6111b4f81cbc1a49f5900ac4666bb93ac027feaecf15607bf" [[package]] name = "big_s" @@ -533,9 +533,9 @@ checksum = "b4ae4235e6dac0694637c763029ecea1a2ec9e4e06ec2729bd21ba4d9c863eb7" [[package]] name = "bumpalo" -version = "3.11.0" +version = "3.11.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c1ad822118d20d2c234f427000d5acc36eabe1e29a348c89b63dd60b13f28e5d" +checksum = "572f695136211188308f16ad2ca5c851a712c464060ae6974944458eb83880ba" [[package]] name = "byte-unit" @@ -568,9 +568,9 @@ version = "1.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1b9e1f5fa78f69496407a27ae9ed989e3c3b072310286f5ef385525e4cbc24a9" dependencies = [ - "proc-macro2 1.0.46", + "proc-macro2 1.0.47", "quote 1.0.21", - "syn 1.0.101", + "syn 1.0.102", ] [[package]] @@ -679,9 +679,9 @@ dependencies = [ [[package]] name = "character_converter" -version = "2.1.3" +version = "2.1.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a75387a5aa327fed13de2adb87ec4bcb351943bfb30af7004405a39da430c390" +checksum = "14eb54f15451a7095181d32b3ac148ba3684ab8dc261a74208b2063c9293bb1c" dependencies = [ "bincode", "fst", @@ -716,13 +716,13 @@ dependencies = [ [[package]] name = "clap" -version = "4.0.9" +version = "4.0.17" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "30607dd93c420c6f1f80b544be522a0238a7db35e6a12968d28910983fee0df0" +checksum = "06badb543e734a2d6568e19a40af66ed5364360b9226184926f89d229b4b4267" dependencies = [ "atty", "bitflags", - "clap_derive 4.0.9", + "clap_derive 4.0.13", "clap_lex 0.3.0", "once_cell", "strsim", @@ -737,22 +737,22 @@ checksum = "ea0c8bce528c4be4da13ea6fead8965e95b6073585a2f05204bd8f4119f82a65" dependencies = [ "heck", "proc-macro-error", - "proc-macro2 1.0.46", + "proc-macro2 1.0.47", "quote 1.0.21", - "syn 1.0.101", + "syn 1.0.102", ] [[package]] name = "clap_derive" -version = "4.0.9" +version = "4.0.13" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a4a307492e1a34939f79d3b6b9650bd2b971513cd775436bf2b78defeb5af00b" +checksum = "c42f169caba89a7d512b5418b09864543eeb4d497416c917d7137863bd2076ad" dependencies = [ "heck", "proc-macro-error", - "proc-macro2 1.0.46", + "proc-macro2 1.0.47", "quote 1.0.21", - "syn 1.0.101", + "syn 1.0.102", ] [[package]] @@ -779,9 +779,9 @@ version = "0.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1df715824eb382e34b7afb7463b0247bf41538aeba731fba05241ecdb5dc3747" dependencies = [ - "proc-macro2 1.0.46", + "proc-macro2 1.0.47", "quote 1.0.21", - "syn 1.0.101", + "syn 1.0.102", ] [[package]] @@ -1000,10 +1000,10 @@ checksum = "649c91bc01e8b1eac09fb91e8dbc7d517684ca6be8ebc75bb9cafc894f9fdb6f" dependencies = [ "fnv", "ident_case", - "proc-macro2 1.0.46", + "proc-macro2 1.0.47", "quote 1.0.21", "strsim", - "syn 1.0.101", + "syn 1.0.102", ] [[package]] @@ -1014,7 +1014,7 @@ checksum = "ddfc69c5bfcbd2fc09a0f38451d2daf0e372e367986a83906d1b0dbc88134fb5" dependencies = [ "darling_core", "quote 1.0.21", - "syn 1.0.101", + "syn 1.0.102", ] [[package]] @@ -1033,9 +1033,9 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1f91d4cfa921f1c05904dc3c57b4a32c38aed3340cce209f3a6fd1478babafc4" dependencies = [ "darling", - "proc-macro2 1.0.46", + "proc-macro2 1.0.47", "quote 1.0.21", - "syn 1.0.101", + "syn 1.0.102", ] [[package]] @@ -1045,7 +1045,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8f0314b72bed045f3a68671b3c86328386762c93f82d98c65c3cb5e5f573dd68" dependencies = [ "derive_builder_core", - "syn 1.0.101", + "syn 1.0.102", ] [[package]] @@ -1055,10 +1055,10 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4fb810d30a7c1953f91334de7244731fc3f3c10d7fe163338a35b9f640960321" dependencies = [ "convert_case", - "proc-macro2 1.0.46", + "proc-macro2 1.0.47", "quote 1.0.21", "rustc_version 0.4.0", - "syn 1.0.101", + "syn 1.0.102", ] [[package]] @@ -1107,7 +1107,6 @@ dependencies = [ "big_s", "flate2", "http", - "index-scheduler", "insta", "log", "maplit", @@ -1116,13 +1115,14 @@ dependencies = [ "meilisearch-types", "once_cell", "regex", + "roaring", "serde", "serde_json", "tar", "tempfile", "thiserror", "time", - "uuid 1.1.2", + "uuid 1.2.1", ] [[package]] @@ -1223,33 +1223,13 @@ dependencies = [ "cfg-if", ] -[[package]] -name = "enum-iterator" -version = "0.7.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4eeac5c5edb79e4e39fe8439ef35207780a11f69c52cbe424ce3dfad4cb78de6" -dependencies = [ - "enum-iterator-derive 0.7.0", -] - [[package]] name = "enum-iterator" version = "1.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "45a0ac4aeb3a18f92eaf09c6bb9b3ac30ff61ca95514fc58cbead1c9a6bf5401" dependencies = [ - "enum-iterator-derive 1.1.0", -] - -[[package]] -name = "enum-iterator-derive" -version = "0.7.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c134c37760b27a871ba422106eedbb8247da973a09e82558bf26d619c882b159" -dependencies = [ - "proc-macro2 1.0.46", - "quote 1.0.21", - "syn 1.0.101", + "enum-iterator-derive", ] [[package]] @@ -1258,9 +1238,9 @@ version = "1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "828de45d0ca18782232dfb8f3ea9cc428e8ced380eb26a520baaacfc70de39ce" dependencies = [ - "proc-macro2 1.0.46", + "proc-macro2 1.0.47", "quote 1.0.21", - "syn 1.0.101", + "syn 1.0.102", ] [[package]] @@ -1302,9 +1282,9 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "35c9bb4a2c13ffb3a93a39902aaf4e7190a1706a4779b6db0449aee433d26c4a" dependencies = [ "darling", - "proc-macro2 1.0.46", + "proc-macro2 1.0.47", "quote 1.0.21", - "syn 1.0.101", + "syn 1.0.102", "uuid 0.8.2", ] @@ -1315,7 +1295,7 @@ dependencies = [ "faux", "tempfile", "thiserror", - "uuid 1.1.2", + "uuid 1.2.1", ] [[package]] @@ -1327,7 +1307,7 @@ dependencies = [ "cfg-if", "libc", "redox_syscall", - "windows-sys", + "windows-sys 0.36.1", ] [[package]] @@ -1380,9 +1360,9 @@ checksum = "7ab85b9b05e3978cc9a9cf8fea7f01b494e1a09ed3037e16ba39edc7a29eb61a" [[package]] name = "futures" -version = "0.3.24" +version = "0.3.25" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7f21eda599937fba36daeb58a22e8f5cee2d14c4a17b5b7739c7c8e5e3b8230c" +checksum = "38390104763dc37a5145a53c29c63c1290b5d316d6086ec32c293f6736051bb0" dependencies = [ "futures-channel", "futures-core", @@ -1395,9 +1375,9 @@ dependencies = [ [[package]] name = "futures-channel" -version = "0.3.24" +version = "0.3.25" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "30bdd20c28fadd505d0fd6712cdfcb0d4b5648baf45faef7f852afb2399bb050" +checksum = "52ba265a92256105f45b719605a571ffe2d1f0fea3807304b522c1d778f79eed" dependencies = [ "futures-core", "futures-sink", @@ -1405,15 +1385,15 @@ dependencies = [ [[package]] name = "futures-core" -version = "0.3.24" +version = "0.3.25" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4e5aa3de05362c3fb88de6531e6296e85cde7739cccad4b9dfeeb7f6ebce56bf" +checksum = "04909a7a7e4633ae6c4a9ab280aeb86da1236243a77b694a49eacd659a4bd3ac" [[package]] name = "futures-executor" -version = "0.3.24" +version = "0.3.25" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9ff63c23854bee61b6e9cd331d523909f238fc7636290b96826e9cfa5faa00ab" +checksum = "7acc85df6714c176ab5edf386123fafe217be88c0840ec11f199441134a074e2" dependencies = [ "futures-core", "futures-task", @@ -1422,38 +1402,38 @@ dependencies = [ [[package]] name = "futures-io" -version = "0.3.24" +version = "0.3.25" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bbf4d2a7a308fd4578637c0b17c7e1c7ba127b8f6ba00b29f717e9655d85eb68" +checksum = "00f5fb52a06bdcadeb54e8d3671f8888a39697dcb0b81b23b55174030427f4eb" [[package]] name = "futures-macro" -version = "0.3.24" +version = "0.3.25" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "42cd15d1c7456c04dbdf7e88bcd69760d74f3a798d6444e16974b505b0e62f17" +checksum = "bdfb8ce053d86b91919aad980c220b1fb8401a9394410e1c289ed7e66b61835d" dependencies = [ - "proc-macro2 1.0.46", + "proc-macro2 1.0.47", "quote 1.0.21", - "syn 1.0.101", + "syn 1.0.102", ] [[package]] name = "futures-sink" -version = "0.3.24" +version = "0.3.25" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "21b20ba5a92e727ba30e72834706623d94ac93a725410b6a6b6fbc1b07f7ba56" +checksum = "39c15cf1a4aa79df40f1bb462fb39676d0ad9e366c2a33b590d7c66f4f81fcf9" [[package]] name = "futures-task" -version = "0.3.24" +version = "0.3.25" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a6508c467c73851293f390476d4491cf4d227dbabcd4170f3bb6044959b294f1" +checksum = "2ffb393ac5d9a6eaa9d3fdf37ae2776656b706e200c8e16b1bdb227f5198e6ea" [[package]] name = "futures-util" -version = "0.3.24" +version = "0.3.25" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "44fb6cb1be61cc1d2e43b262516aafcf63b241cffdb1d3fa115f91d9c7b09c90" +checksum = "197676987abd2f9cadff84926f410af1c183608d36641465df73ae8211dc65d6" dependencies = [ "futures-channel", "futures-core", @@ -1510,9 +1490,9 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e45727250e75cc04ff2846a66397da8ef2b3db8e40e0cef4df67950a07621eb9" dependencies = [ "proc-macro-error", - "proc-macro2 1.0.46", + "proc-macro2 1.0.47", "quote 1.0.21", - "syn 1.0.101", + "syn 1.0.102", ] [[package]] @@ -1680,7 +1660,7 @@ checksum = "75f43d41e26995c17e71ee126451dd3941010b0514a81a9d11f3b341debc2399" dependencies = [ "bytes", "fnv", - "itoa 1.0.3", + "itoa 1.0.4", ] [[package]] @@ -1727,7 +1707,7 @@ dependencies = [ "http-body", "httparse", "httpdate", - "itoa 1.0.3", + "itoa 1.0.4", "pin-project-lite", "socket2", "tokio", @@ -1775,6 +1755,7 @@ dependencies = [ "crossbeam", "csv", "derive_builder", + "dump", "file-store", "insta", "log", @@ -1788,7 +1769,7 @@ dependencies = [ "tempfile", "thiserror", "time", - "uuid 1.1.2", + "uuid 1.2.1", ] [[package]] @@ -1850,9 +1831,9 @@ checksum = "b71991ff56294aa922b450139ee08b3bfc70982c6b2c7562771375cf73542dd4" [[package]] name = "itoa" -version = "1.0.3" +version = "1.0.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6c8af84674fe1f223a982c933a0ee1086ac4d4052aa0fb8060c12c6ad838e754" +checksum = "4217ad341ebadf8d8e724e264f13e593e0648f5b3e94b3896a5df283be015ecc" [[package]] name = "jieba-rs" @@ -1932,9 +1913,9 @@ dependencies = [ [[package]] name = "libc" -version = "0.2.134" +version = "0.2.135" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "329c933548736bc49fd575ee68c89e8be4d260064184389a5b77517cddd99ffb" +checksum = "68783febc7782c6c5cb401fbda4de5a9898be1762314da0bb2c10ced61f18b0c" [[package]] name = "libgit2-sys" @@ -1956,9 +1937,9 @@ checksum = "292a948cd991e376cf75541fe5b97a1081d713c618b4f1b9500f8844e49eb565" [[package]] name = "libmimalloc-sys" -version = "0.1.25" +version = "0.1.26" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "11ca136052550448f55df7898c6dbe651c6b574fe38a0d9ea687a9f8088a2e2c" +checksum = "8fc093ab289b0bfda3aa1bdfab9c9542be29c7ef385cfcbe77f8c9813588eb48" dependencies = [ "cc", ] @@ -2202,9 +2183,9 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "10a9062912d7952c5588cc474795e0b9ee008e7e6781127945b85413d4b99d81" dependencies = [ "log", - "proc-macro2 1.0.46", + "proc-macro2 1.0.47", "quote 1.0.21", - "syn 1.0.101", + "syn 1.0.102", ] [[package]] @@ -2224,9 +2205,9 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f08150cf2bab1fc47c2196f4f41173a27fcd0f684165e5458c0046b53a472e2f" dependencies = [ "once_cell", - "proc-macro2 1.0.46", + "proc-macro2 1.0.47", "quote 1.0.21", - "syn 1.0.101", + "syn 1.0.102", ] [[package]] @@ -2254,16 +2235,17 @@ dependencies = [ name = "meilisearch-auth" version = "0.29.1" dependencies = [ - "enum-iterator 1.1.3", + "enum-iterator", "hmac", "meilisearch-types", "rand", + "roaring", "serde", "serde_json", "sha2", "thiserror", "time", - "uuid 1.1.2", + "uuid 1.2.1", ] [[package]] @@ -2284,7 +2266,7 @@ dependencies = [ "byte-unit", "bytes", "cargo_toml", - "clap 4.0.9", + "clap 4.0.17", "crossbeam-channel", "dump", "either", @@ -2341,7 +2323,7 @@ dependencies = [ "tokio-stream", "toml", "urlencoding", - "uuid 1.1.2", + "uuid 1.2.1", "vergen", "walkdir", "yaup", @@ -2355,7 +2337,8 @@ dependencies = [ "actix-web", "csv", "either", - "enum-iterator 0.7.0", + "enum-iterator", + "fst", "insta", "meili-snap", "milli", @@ -2367,7 +2350,7 @@ dependencies = [ "thiserror", "time", "tokio", - "uuid 1.1.2", + "uuid 1.2.1", ] [[package]] @@ -2436,14 +2419,14 @@ dependencies = [ "tempfile", "thiserror", "time", - "uuid 1.1.2", + "uuid 1.2.1", ] [[package]] name = "mimalloc" -version = "0.1.29" +version = "0.1.30" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2f64ad83c969af2e732e907564deb0d0ed393cec4af80776f77dd77a1a427698" +checksum = "76ce6a4b40d3bff9eb3ce9881ca0737a85072f9f975886082640cd46a75cdb35" dependencies = [ "libmimalloc-sys", ] @@ -2488,7 +2471,7 @@ dependencies = [ "libc", "log", "wasi", - "windows-sys", + "windows-sys 0.36.1", ] [[package]] @@ -2655,22 +2638,22 @@ dependencies = [ [[package]] name = "parking_lot_core" -version = "0.9.3" +version = "0.9.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "09a279cbf25cb0757810394fbc1e359949b59e348145c643a939a525692e6929" +checksum = "4dc9e0dc2adc1c69d09143aff38d3d30c5c3f0df0dad82e6d25547af174ebec0" dependencies = [ "cfg-if", "libc", "redox_syscall", "smallvec", - "windows-sys", + "windows-sys 0.42.0", ] [[package]] name = "password-hash" -version = "0.3.2" +version = "0.4.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1d791538a6dcc1e7cb7fe6f6b58aca40e7f79403c45b2bc274008b5e647af1d8" +checksum = "7676374caaee8a325c9e7a2ae557f216c5563a171d6997b0ef8a65af35147700" dependencies = [ "base64ct", "rand_core", @@ -2700,9 +2683,9 @@ checksum = "498a099351efa4becc6a19c72aa9270598e8fd274ca47052e37455241c88b696" [[package]] name = "pbkdf2" -version = "0.10.1" +version = "0.11.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "271779f35b581956db91a3e55737327a03aa051e90b1c47aeb189508533adfd7" +checksum = "83a0692ec44e4cf1ef28ca317f14f8f07da2d95ec3fa01f86e4467b725e60917" dependencies = [ "digest", "hmac", @@ -2761,9 +2744,9 @@ checksum = "f4f9272122f5979a6511a749af9db9bfc810393f63119970d7085fed1c4ea0db" dependencies = [ "pest", "pest_meta", - "proc-macro2 1.0.46", + "proc-macro2 1.0.47", "quote 1.0.21", - "syn 1.0.101", + "syn 1.0.102", ] [[package]] @@ -2855,9 +2838,9 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "da25490ff9892aab3fcf7c36f08cfb902dd3e71ca0f9f9517bea02a73a5ce38c" dependencies = [ "proc-macro-error-attr", - "proc-macro2 1.0.46", + "proc-macro2 1.0.47", "quote 1.0.21", - "syn 1.0.101", + "syn 1.0.102", "version_check", ] @@ -2867,7 +2850,7 @@ version = "1.0.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a1be40180e52ecc98ad80b184934baf3d0d29f979574e439af5a55274b35f869" dependencies = [ - "proc-macro2 1.0.46", + "proc-macro2 1.0.47", "quote 1.0.21", "version_check", ] @@ -2883,9 +2866,9 @@ dependencies = [ [[package]] name = "proc-macro2" -version = "1.0.46" +version = "1.0.47" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "94e2ef8dbfc347b10c094890f778ee2e36ca9bb4262e86dc99cd217e35f3470b" +checksum = "5ea3d908b0e36316caf9e9e2c4625cdde190a7e6f440d794667ed17a1855e725" dependencies = [ "unicode-ident", ] @@ -2984,7 +2967,7 @@ version = "1.0.21" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "bbe448f377a7d6961e30f5955f9b8d106c3f5e449d493ee1b125c1d43c2b5179" dependencies = [ - "proc-macro2 1.0.46", + "proc-macro2 1.0.47", ] [[package]] @@ -3233,9 +3216,9 @@ dependencies = [ [[package]] name = "rustls" -version = "0.20.6" +version = "0.20.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5aab8ee6c7097ed6057f43c187a62418d0c05a4bd5f18b3571db50ee0f9ce033" +checksum = "539a2bfe908f471bfa933876bd1eb6a19cf2176d375f82ef7f99530a40e48c2c" dependencies = [ "log", "ring", @@ -3360,19 +3343,19 @@ version = "1.0.145" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "81fa1584d3d1bcacd84c277a0dfe21f5b0f6accf4a23d04d4c6d61f1af522b4c" dependencies = [ - "proc-macro2 1.0.46", + "proc-macro2 1.0.47", "quote 1.0.21", - "syn 1.0.101", + "syn 1.0.102", ] [[package]] name = "serde_json" -version = "1.0.85" +version = "1.0.87" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e55a28e3aaef9d5ce0506d0a14dbba8054ddc7e499ef522dd8b26859ec9d4a44" +checksum = "6ce777b7b150d76b9cf60d28b55f5847135a003f7d7350c6be7a773508ce7d45" dependencies = [ "indexmap", - "itoa 1.0.3", + "itoa 1.0.4", "ryu", "serde", ] @@ -3384,7 +3367,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d3491c14715ca2294c4d6a88f15e84739788c1d030eed8c110436aafdaa2f3fd" dependencies = [ "form_urlencoded", - "itoa 1.0.3", + "itoa 1.0.4", "ryu", "serde", ] @@ -3570,11 +3553,11 @@ dependencies = [ [[package]] name = "syn" -version = "1.0.101" +version = "1.0.102" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e90cde112c4b9690b8cbe810cba9ddd8bc1d7472e2cae317b69e9438c1cba7d2" +checksum = "3fcd952facd492f9be3ef0d0b7032a6e442ee9b361d4acc2b1d0c4aaa5f613a1" dependencies = [ - "proc-macro2 1.0.46", + "proc-macro2 1.0.47", "quote 1.0.21", "unicode-ident", ] @@ -3594,17 +3577,17 @@ version = "0.12.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f36bdaa60a83aca3921b5259d5400cbf5e90fc51931376a9bd4a0eb79aa7210f" dependencies = [ - "proc-macro2 1.0.46", + "proc-macro2 1.0.47", "quote 1.0.21", - "syn 1.0.101", + "syn 1.0.102", "unicode-xid 0.2.4", ] [[package]] name = "sysinfo" -version = "0.26.4" +version = "0.26.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7890fff842b8db56f2033ebee8f6efe1921475c3830c115995552914fb967580" +checksum = "ade661fa5e048ada64ad7901713301c21d2dbc5b65ee7967de8826c111452960" dependencies = [ "cfg-if", "core-foundation-sys", @@ -3689,9 +3672,9 @@ version = "1.0.37" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "982d17546b47146b28f7c22e3d08465f6b8903d0ea13c1660d9d84a6e7adcdbb" dependencies = [ - "proc-macro2 1.0.46", + "proc-macro2 1.0.47", "quote 1.0.21", - "syn 1.0.101", + "syn 1.0.102", ] [[package]] @@ -3700,7 +3683,7 @@ version = "0.3.15" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d634a985c4d4238ec39cacaed2e7ae552fbd3c476b552c1deac3021b7d7eaf0c" dependencies = [ - "itoa 1.0.3", + "itoa 1.0.4", "libc", "num_threads", "serde", @@ -3754,9 +3737,9 @@ version = "1.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9724f9a975fb987ef7a3cd9be0350edcbe130698af5b8f7a631e23d42d052484" dependencies = [ - "proc-macro2 1.0.46", + "proc-macro2 1.0.47", "quote 1.0.21", - "syn 1.0.101", + "syn 1.0.102", ] [[package]] @@ -3772,9 +3755,9 @@ dependencies = [ [[package]] name = "tokio-stream" -version = "0.1.10" +version = "0.1.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f6edf2d6bc038a43d31353570e27270603f4648d18f5ed10c0e179abe43255af" +checksum = "d660770404473ccd7bc9f8b28494a811bc18542b915c0855c51e8f419d5223ce" dependencies = [ "futures-core", "pin-project-lite", @@ -3812,9 +3795,9 @@ checksum = "b6bc1c9ce2b5135ac7f93c72918fc37feb872bdc6a5533a8b85eb4b86bfdae52" [[package]] name = "tracing" -version = "0.1.36" +version = "0.1.37" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2fce9567bd60a67d08a16488756721ba392f24f29006402881e43b19aac64307" +checksum = "8ce8c33a8d48bd45d624a6e523445fd21ec13d3653cd51f681abf67418f54eb8" dependencies = [ "cfg-if", "log", @@ -3824,9 +3807,9 @@ dependencies = [ [[package]] name = "tracing-core" -version = "0.1.29" +version = "0.1.30" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5aeea4303076558a00714b823f9ad67d58a3bbda1df83d8827d21193156e22f7" +checksum = "24eb03ba0eab1fd845050058ce5e616558e8f8d8fca633e6b163fe25c797213a" dependencies = [ "once_cell", ] @@ -3866,9 +3849,9 @@ checksum = "099b7128301d285f79ddd55b9a83d5e6b9e97c92e0ea0daebee7263e932de992" [[package]] name = "unicode-ident" -version = "1.0.4" +version = "1.0.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dcc811dc4066ac62f84f11307873c4850cb653bfa9b1719cee2bd2204a4bc5dd" +checksum = "6ceab39d59e4c9499d4e5a8ee0e2735b891bb7308ac83dfb4e80cad195c9f6f3" [[package]] name = "unicode-normalization" @@ -3937,9 +3920,9 @@ dependencies = [ [[package]] name = "uuid" -version = "1.1.2" +version = "1.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dd6469f4314d5f1ffec476e05f17cc9a78bc7a27a6a857842170bdf8d6f98d2f" +checksum = "feb41e78f93363bb2df8b0e86a2ca30eed7806ea16ea0c790d757cf93f79be83" dependencies = [ "getrandom", "serde", @@ -3965,7 +3948,7 @@ checksum = "73ba753d713ec3844652ad2cb7eb56bc71e34213a14faddac7852a10ba88f61e" dependencies = [ "anyhow", "cfg-if", - "enum-iterator 1.1.3", + "enum-iterator", "getset", "git2", "rustversion", @@ -4049,9 +4032,9 @@ dependencies = [ "bumpalo", "log", "once_cell", - "proc-macro2 1.0.46", + "proc-macro2 1.0.47", "quote 1.0.21", - "syn 1.0.101", + "syn 1.0.102", "wasm-bindgen-shared", ] @@ -4083,9 +4066,9 @@ version = "0.2.83" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "07bc0c051dc5f23e307b13285f9d75df86bfdf816c5721e573dec1f9b8aa193c" dependencies = [ - "proc-macro2 1.0.46", + "proc-macro2 1.0.47", "quote 1.0.21", - "syn 1.0.101", + "syn 1.0.102", "wasm-bindgen-backend", "wasm-bindgen-shared", ] @@ -4171,43 +4154,100 @@ version = "0.36.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ea04155a16a59f9eab786fe12a4a450e75cdb175f9e0d80da1e17db09f55b8d2" dependencies = [ - "windows_aarch64_msvc", - "windows_i686_gnu", - "windows_i686_msvc", - "windows_x86_64_gnu", - "windows_x86_64_msvc", + "windows_aarch64_msvc 0.36.1", + "windows_i686_gnu 0.36.1", + "windows_i686_msvc 0.36.1", + "windows_x86_64_gnu 0.36.1", + "windows_x86_64_msvc 0.36.1", ] +[[package]] +name = "windows-sys" +version = "0.42.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5a3e1820f08b8513f676f7ab6c1f99ff312fb97b553d30ff4dd86f9f15728aa7" +dependencies = [ + "windows_aarch64_gnullvm", + "windows_aarch64_msvc 0.42.0", + "windows_i686_gnu 0.42.0", + "windows_i686_msvc 0.42.0", + "windows_x86_64_gnu 0.42.0", + "windows_x86_64_gnullvm", + "windows_x86_64_msvc 0.42.0", +] + +[[package]] +name = "windows_aarch64_gnullvm" +version = "0.42.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "41d2aa71f6f0cbe00ae5167d90ef3cfe66527d6f613ca78ac8024c3ccab9a19e" + [[package]] name = "windows_aarch64_msvc" version = "0.36.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9bb8c3fd39ade2d67e9874ac4f3db21f0d710bee00fe7cab16949ec184eeaa47" +[[package]] +name = "windows_aarch64_msvc" +version = "0.42.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dd0f252f5a35cac83d6311b2e795981f5ee6e67eb1f9a7f64eb4500fbc4dcdb4" + [[package]] name = "windows_i686_gnu" version = "0.36.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "180e6ccf01daf4c426b846dfc66db1fc518f074baa793aa7d9b9aaeffad6a3b6" +[[package]] +name = "windows_i686_gnu" +version = "0.42.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fbeae19f6716841636c28d695375df17562ca208b2b7d0dc47635a50ae6c5de7" + [[package]] name = "windows_i686_msvc" version = "0.36.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e2e7917148b2812d1eeafaeb22a97e4813dfa60a3f8f78ebe204bcc88f12f024" +[[package]] +name = "windows_i686_msvc" +version = "0.42.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "84c12f65daa39dd2babe6e442988fc329d6243fdce47d7d2d155b8d874862246" + [[package]] name = "windows_x86_64_gnu" version = "0.36.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4dcd171b8776c41b97521e5da127a2d86ad280114807d0b2ab1e462bc764d9e1" +[[package]] +name = "windows_x86_64_gnu" +version = "0.42.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bf7b1b21b5362cbc318f686150e5bcea75ecedc74dd157d874d754a2ca44b0ed" + +[[package]] +name = "windows_x86_64_gnullvm" +version = "0.42.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "09d525d2ba30eeb3297665bd434a54297e4170c7f1a44cad4ef58095b4cd2028" + [[package]] name = "windows_x86_64_msvc" version = "0.36.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c811ca4a8c853ef420abd8592ba53ddbbac90410fab6903b3e79972a631f7680" +[[package]] +name = "windows_x86_64_msvc" +version = "0.42.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f40009d85759725a34da6d89a94e63d7bdc50a862acf0dbc7c8e488f1edcb6f5" + [[package]] name = "winreg" version = "0.10.1" @@ -4267,16 +4307,16 @@ version = "0.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d498dbd1fd7beb83c86709ae1c33ca50942889473473d287d56ce4770a18edfb" dependencies = [ - "proc-macro2 1.0.46", - "syn 1.0.101", + "proc-macro2 1.0.47", + "syn 1.0.102", "synstructure", ] [[package]] name = "zip" -version = "0.6.2" +version = "0.6.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bf225bcf73bb52cbb496e70475c7bd7a3f769df699c0020f6c7bd9a96dcf0b8d" +checksum = "537ce7411d25e54e8ae21a7ce0b15840e7bfcff15b51d697ec3266cc76bdf080" dependencies = [ "aes", "byteorder", @@ -4294,18 +4334,18 @@ dependencies = [ [[package]] name = "zstd" -version = "0.10.2+zstd.1.5.2" +version = "0.11.2+zstd.1.5.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5f4a6bd64f22b5e3e94b4e238669ff9f10815c27a5180108b849d24174a83847" +checksum = "20cc960326ece64f010d2d2107537f26dc589a6573a316bd5b1dba685fa5fde4" dependencies = [ "zstd-safe", ] [[package]] name = "zstd-safe" -version = "4.1.6+zstd.1.5.2" +version = "5.0.2+zstd.1.5.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "94b61c51bb270702d6167b8ce67340d2754b088d0c091b06e593aa772c3ee9bb" +checksum = "1d2a5585e04f9eea4b2a3d1eca508c4dee9592a89ef6f450c11719da0726f4db" dependencies = [ "libc", "zstd-sys", @@ -4313,9 +4353,9 @@ dependencies = [ [[package]] name = "zstd-sys" -version = "1.6.3+zstd.1.5.2" +version = "2.0.1+zstd.1.5.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fc49afa5c8d634e75761feda8c592051e7eeb4683ba827211eb0d731d3402ea8" +checksum = "9fd07cbbc53846d9145dbffdf6dd09a7a0aa52be46741825f5c97bdd4f73f12b" dependencies = [ "cc", "libc", diff --git a/meilisearch-auth/Cargo.toml b/meilisearch-auth/Cargo.toml index b10579615..f8c851ff4 100644 --- a/meilisearch-auth/Cargo.toml +++ b/meilisearch-auth/Cargo.toml @@ -4,7 +4,7 @@ version = "0.29.1" edition = "2021" [dependencies] -enum-iterator = "1.1.2" +enum-iterator = "1.1.3" hmac = "0.12.1" meilisearch-types = { path = "../meilisearch-types" } rand = "0.8.5" diff --git a/meilisearch-auth/src/error.rs b/meilisearch-auth/src/error.rs index 7da4cad33..37d3dce60 100644 --- a/meilisearch-auth/src/error.rs +++ b/meilisearch-auth/src/error.rs @@ -1,7 +1,7 @@ use std::error::Error; use meilisearch_types::error::{Code, ErrorCode}; -use meilisearch_types::{internal_error, keys, milli}; +use meilisearch_types::{internal_error, keys}; pub type Result = std::result::Result; diff --git a/meilisearch-auth/src/store.rs b/meilisearch-auth/src/store.rs index 3a2673f10..e5383cf32 100644 --- a/meilisearch-auth/src/store.rs +++ b/meilisearch-auth/src/store.rs @@ -13,7 +13,6 @@ use hmac::{Hmac, Mac}; use meilisearch_types::keys::KeyId; use meilisearch_types::milli; use meilisearch_types::star_or::StarOr; -use meilisearch_types::milli; use milli::heed::types::{ByteSlice, DecodeIgnore, SerdeJson}; use milli::heed::{Database, Env, EnvOpenOptions, RwTxn}; use sha2::Sha256; diff --git a/meilisearch-types/Cargo.toml b/meilisearch-types/Cargo.toml index 498153ad1..090862919 100644 --- a/meilisearch-types/Cargo.toml +++ b/meilisearch-types/Cargo.toml @@ -9,7 +9,7 @@ actix-web = { version = "4.2.1", default-features = false } csv = "1.1.6" either = { version = "1.6.1", features = ["serde"] } milli = { git = "https://github.com/meilisearch/milli.git", branch = "indexation-abortion", default-features = false } -enum-iterator = "0.7.0" +enum-iterator = "1.1.3" fst = "0.4.7" proptest = { version = "1.0.0", optional = true } proptest-derive = { version = "0.3.0", optional = true } diff --git a/meilisearch-types/src/keys.rs b/meilisearch-types/src/keys.rs index 50c776767..b03d3ed08 100644 --- a/meilisearch-types/src/keys.rs +++ b/meilisearch-types/src/keys.rs @@ -1,7 +1,7 @@ use crate::error::{Code, ErrorCode}; use crate::index_uid::IndexUid; use crate::star_or::StarOr; -use enum_iterator::IntoEnumIterator; +use enum_iterator::Sequence; use serde::{Deserialize, Serialize}; use serde_json::{from_value, Value}; use std::hash::Hash; @@ -197,7 +197,7 @@ fn parse_expiration_date(value: &Value) -> Result> { } } -#[derive(IntoEnumIterator, Copy, Clone, Serialize, Deserialize, Debug, Eq, PartialEq, Hash)] +#[derive(Copy, Clone, Serialize, Deserialize, Debug, Eq, PartialEq, Hash, Sequence)] #[repr(u8)] pub enum Action { #[serde(rename = "*")] diff --git a/meilisearch-types/src/tasks.rs b/meilisearch-types/src/tasks.rs index ead3dd8c3..98994c072 100644 --- a/meilisearch-types/src/tasks.rs +++ b/meilisearch-types/src/tasks.rs @@ -1,3 +1,4 @@ +use enum_iterator::Sequence; use milli::update::IndexDocumentsMethod; use roaring::RoaringBitmap; use serde::{Deserialize, Serialize, Serializer}; @@ -263,7 +264,7 @@ impl From<&KindWithContent> for Option
{ } } -#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash, Serialize, Deserialize)] +#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash, Serialize, Deserialize, Sequence)] #[serde(rename_all = "camelCase")] pub enum Status { Enqueued, @@ -286,21 +287,32 @@ impl Display for Status { impl FromStr for Status { type Err = ResponseError; - fn from_str(s: &str) -> Result { - match s { - "enqueued" => Ok(Status::Enqueued), - "processing" => Ok(Status::Processing), - "succeeded" => Ok(Status::Succeeded), - "failed" => Ok(Status::Failed), - s => Err(ResponseError::from_msg( - format!("`{}` is not a status. Available types are", s), + fn from_str(status: &str) -> Result { + if status.eq_ignore_ascii_case("enqueued") { + Ok(Status::Enqueued) + } else if status.eq_ignore_ascii_case("processing") { + Ok(Status::Processing) + } else if status.eq_ignore_ascii_case("succeeded") { + Ok(Status::Succeeded) + } else if status.eq_ignore_ascii_case("failed") { + Ok(Status::Failed) + } else { + Err(ResponseError::from_msg( + format!( + "`{}` is not a status. Available status are {}.", + status, + enum_iterator::all::() + .map(|s| format!("`{s}`")) + .collect::>() + .join(", ") + ), Code::BadRequest, - )), + )) } } } -#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash, Serialize, Deserialize)] +#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash, Serialize, Deserialize, Sequence)] #[serde(rename_all = "camelCase")] pub enum Kind { DocumentImport, @@ -320,25 +332,37 @@ pub enum Kind { impl FromStr for Kind { type Err = ResponseError; - fn from_str(s: &str) -> Result { - match s { - "document_addition" => Ok(Kind::DocumentImport), - "document_update" => Ok(Kind::DocumentImport), - "document_deletion" => Ok(Kind::DocumentDeletion), - "document_clear" => Ok(Kind::DocumentClear), - "settings" => Ok(Kind::Settings), - "index_creation" => Ok(Kind::IndexCreation), - "index_deletion" => Ok(Kind::IndexDeletion), - "index_update" => Ok(Kind::IndexUpdate), - "index_swap" => Ok(Kind::IndexSwap), - "cancel_task" => Ok(Kind::CancelTask), - "task_deletion" => Ok(Kind::TaskDeletion), - "dump_export" => Ok(Kind::DumpExport), - "snapshot" => Ok(Kind::Snapshot), - s => Err(ResponseError::from_msg( - format!("`{}` is not a type. Available status are ", s), + fn from_str(kind: &str) -> Result { + if kind.eq_ignore_ascii_case("indexCreation") { + Ok(Kind::IndexCreation) + } else if kind.eq_ignore_ascii_case("indexUpdate") { + Ok(Kind::IndexUpdate) + } else if kind.eq_ignore_ascii_case("indexDeletion") { + Ok(Kind::IndexDeletion) + } else if kind.eq_ignore_ascii_case("documentAdditionOrUpdate") { + Ok(Kind::DocumentImport) + } else if kind.eq_ignore_ascii_case("documentDeletion") { + Ok(Kind::DocumentDeletion) + } else if kind.eq_ignore_ascii_case("settingsUpdate") { + Ok(Kind::Settings) + } else if kind.eq_ignore_ascii_case("dumpCreation") { + Ok(Kind::DumpExport) + } else { + Err(ResponseError::from_msg( + format!( + "`{}` is not a type. Available types are {}.", + kind, + enum_iterator::all::() + .map(|k| format!( + "`{}`", + // by default serde is going to insert `"` around the value. + serde_json::to_string(&k).unwrap().trim_matches('"') + )) + .collect::>() + .join(", ") + ), Code::BadRequest, - )), + )) } } }