diff --git a/Cargo.lock b/Cargo.lock index 6094da6..f72a685 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -21,9 +21,9 @@ dependencies = [ [[package]] name = "actix-files" -version = "0.6.0" +version = "0.6.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d81bde9a79336aa51ebed236e91fc1a0528ff67cfdf4f68ca4c61ede9fd26fb5" +checksum = "d832782fac6ca7369a70c9ee9a20554623c5e51c76e190ad151780ebea1cf689" dependencies = [ "actix-http", "actix-service", @@ -44,9 +44,9 @@ dependencies = [ [[package]] name = "actix-http" -version = "3.0.4" +version = "3.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a5885cb81a0d4d0d322864bea1bb6c2a8144626b4fdc625d4c51eba197e7797a" +checksum = "6f9ffb6db08c1c3a1f4aef540f1a63193adc73c4fbd40b75a95fc8c5258f6e51" dependencies = [ "actix-codec", "actix-rt", @@ -69,21 +69,21 @@ dependencies = [ "itoa", "language-tags", "local-channel", - "log", "mime", "percent-encoding", "pin-project-lite", "rand", - "sha-1", + "sha1 0.10.1", "smallvec", + "tracing", "zstd", ] [[package]] name = "actix-http-test" -version = "3.0.0-beta.13" +version = "3.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "09594b8a7eaa15da5cfd0e25c779d4b1d6ded62d4a79904f1d91b0dcf97c78e7" +checksum = "f40511826540d084fbcd68ee65b75b1849961c1760a193b09180a4851f20075b" dependencies = [ "actix-codec", "actix-rt", @@ -221,9 +221,9 @@ dependencies = [ [[package]] name = "actix-web" -version = "4.0.1" +version = "4.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f4e5ebffd51d50df56a3ae0de0e59487340ca456f05dd0b90c0a7a6dd6a74d31" +checksum = "a27e8fe9ba4ae613c21f677c2cfaf0696c3744030c6f485b34634e502d6bb379" dependencies = [ "actix-codec", "actix-http", @@ -255,15 +255,15 @@ dependencies = [ "serde_urlencoded", "smallvec", "socket2", - "time 0.3.9", + "time 0.3.14", "url", ] [[package]] name = "actix-web-codegen" -version = "4.0.0" +version = "4.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7525bedf54704abb1d469e88d7e7e9226df73778798a69cea5022d53b2ae91bc" +checksum = "5f270541caec49c15673b0af0e9a00143421ad4f118d2df7edcb68b627632f56" dependencies = [ "actix-router", "proc-macro2", @@ -334,10 +334,19 @@ dependencies = [ ] [[package]] -name = "anyhow" -version = "1.0.56" +name = "android_system_properties" +version = "0.1.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4361135be9122e0870de935d7c439aef945b9f9ddd4199a553b5270b49c82a27" +checksum = "d7ed72e1635e121ca3e79420540282af22da58be50de153d36f81ddc6b83aa9e" +dependencies = [ + "libc", +] + +[[package]] +name = "anyhow" +version = "1.0.62" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1485d4d2cc45e7b201ee3767015c96faa5904387c9d87c6efdd0fb511f12d305" [[package]] name = "ape" @@ -362,9 +371,9 @@ checksum = "d468802bab17cbc0cc575e9b053f41e72aa36bfa6b7f55e3529ffa43161b97fa" [[package]] name = "awc" -version = "3.0.0" +version = "3.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "65c60c44fbf3c8cee365e86b97d706e513b733c4eeb16437b45b88d2fffe889a" +checksum = "80ca7ff88063086d2e2c70b9f3b29b2fcd999bac68ac21731e66781970d68519" dependencies = [ "actix-codec", "actix-http", @@ -396,9 +405,9 @@ dependencies = [ [[package]] name = "base-x" -version = "0.2.8" +version = "0.2.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a4521f3e3d031370679b3b140beb36dfe4801b09ac77e30c61941f97df3ef28b" +checksum = "4cbbc9d0964165b47557570cce6c952866c2678457aca742aafc9fb771d30270" [[package]] name = "base64" @@ -408,9 +417,9 @@ checksum = "904dfeac50f3cdaba28fc6f57fdcddb75f49ed61346676a78c4ffe55877802fd" [[package]] name = "base64ct" -version = "1.5.0" +version = "1.5.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dea908e7347a8c64e378c17e30ef880ad73e3b4498346b055c2c00ea342f3179" +checksum = "ea2b2456fd614d856680dcd9fcc660a51a820fa09daef2e49772b56a193c8474" [[package]] name = "bitflags" @@ -467,15 +476,15 @@ dependencies = [ [[package]] name = "bumpalo" -version = "3.9.1" +version = "3.11.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a4a45a46ab1f2412e53d3a0ade76ffad2025804294569aae387231a0cd6e0899" +checksum = "c1ad822118d20d2c234f427000d5acc36eabe1e29a348c89b63dd60b13f28e5d" [[package]] name = "bytemuck" -version = "1.9.1" +version = "1.12.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cdead85bdec19c194affaeeb670c0e41fe23de31459efd1c174d049269cf02cc" +checksum = "2f5715e491b5a1598fc2bef5a606847b5dc1d48ea625bd3c02c00de8285591da" [[package]] name = "byteorder" @@ -485,15 +494,15 @@ checksum = "14c189c53d098945499cdfa7ecc63567cf3886b3332b312a5b4585d8d3a6a610" [[package]] name = "bytes" -version = "1.1.0" +version = "1.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c4872d67bab6358e59559027aa3b9157c53d9358c51423c17554809a8858e0f8" +checksum = "ec8a7b6a70fde80372154c65702f00a0f56f3e1c36abbc6c440484be248856db" [[package]] name = "bytestring" -version = "1.0.0" +version = "1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "90706ba19e97b90786e19dc0d5e2abd80008d99d4c0c5d1ad0b5e72cec7c494d" +checksum = "86b6a75fd3048808ef06af5cd79712be8111960adaf89d90250974b38fc3928a" dependencies = [ "bytes", ] @@ -515,14 +524,16 @@ checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" [[package]] name = "chrono" -version = "0.4.19" +version = "0.4.22" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "670ad68c9088c2a963aaa298cb369688cf3f9465ce5e2d4ca10e6e0098a1ce73" +checksum = "bfd4d1b31faaa3a89d7934dbded3111da0d2ef28e3ebccdb4f0179f5929d1ef1" dependencies = [ - "libc", + "iana-time-zone", + "js-sys", "num-integer", "num-traits", - "time 0.1.43", + "time 0.1.44", + "wasm-bindgen", "winapi", ] @@ -574,7 +585,7 @@ dependencies = [ "rand", "sha2", "subtle", - "time 0.3.9", + "time 0.3.14", "version_check", ] @@ -595,10 +606,16 @@ dependencies = [ ] [[package]] -name = "cpufeatures" -version = "0.2.2" +name = "core-foundation-sys" +version = "0.8.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "59a6001667ab124aebae2a495118e11d30984c3a653e99d86d58971708cf5e4b" +checksum = "5827cebf4670468b8772dd191856768aedcb1b0278a04f989f7766351917b9dc" + +[[package]] +name = "cpufeatures" +version = "0.2.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dc948ebb96241bb40ab73effeb80d9f93afaad49359d159a5e61be51619fe813" dependencies = [ "libc", ] @@ -614,9 +631,9 @@ dependencies = [ [[package]] name = "crossbeam-channel" -version = "0.5.4" +version = "0.5.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5aaa7bd5fb665c6864b5f963dd9097905c54125909c7aa94c9e18507cdbe6c53" +checksum = "c2dd04ddaf88237dc3b8d8f9a3c1004b506b54b3313403944054d23c0870c521" dependencies = [ "cfg-if", "crossbeam-utils", @@ -624,9 +641,9 @@ dependencies = [ [[package]] name = "crossbeam-deque" -version = "0.8.1" +version = "0.8.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6455c0ca19f0d2fbf751b908d5c55c1f5cbc65e03c4225427254b46890bdde1e" +checksum = "715e8152b692bba2d374b53d4875445368fdf21a94751410af607a5ac677d1fc" dependencies = [ "cfg-if", "crossbeam-epoch", @@ -635,33 +652,33 @@ dependencies = [ [[package]] name = "crossbeam-epoch" -version = "0.9.8" +version = "0.9.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1145cf131a2c6ba0615079ab6a638f7e1973ac9c2634fcbeaaad6114246efe8c" +checksum = "045ebe27666471bb549370b4b0b3e51b07f56325befa4284db65fc89c02511b1" dependencies = [ "autocfg", "cfg-if", "crossbeam-utils", - "lazy_static", "memoffset", + "once_cell", "scopeguard", ] [[package]] name = "crossbeam-utils" -version = "0.8.8" +version = "0.8.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0bf124c720b7686e3c2663cf54062ab0f68a88af2fb6a030e87e30bf721fcb38" +checksum = "51887d4adc7b564537b15adcfb307936f8075dfcd5f00dde9a9f1d29383682bc" dependencies = [ "cfg-if", - "lazy_static", + "once_cell", ] [[package]] name = "crypto-common" -version = "0.1.3" +version = "0.1.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "57952ca27b5e3606ff4dd79b0020231aaf9d6aa76dc05fd30137538c50bd3ce8" +checksum = "1bfb12502f3fc46cca1bb51ac28df9d618d813cdc3d2f25b9fe775a34af26bb3" dependencies = [ "generic-array", "typenum", @@ -707,11 +724,10 @@ dependencies = [ [[package]] name = "diesel" -version = "1.4.8" +version = "2.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b28135ecf6b7d446b43e27e225622a038cc4e2930a1022f51cdb97ada19b8e4d" +checksum = "01e2adfd0a7a81070ed7beec0c62636458926326c16fedb77796d41e447b282d" dependencies = [ - "byteorder", "diesel_derives", "libsqlite3-sys", "r2d2", @@ -719,10 +735,11 @@ dependencies = [ [[package]] name = "diesel_derives" -version = "1.4.1" +version = "2.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "45f5098f628d02a7a0f68ddba586fb61e80edec3bdc1be3b921f4ceec60858d3" +checksum = "22a7ab9d7967e6a1a247ea38aedf88ab808b4ac0c159576bc71866ab8f9f9250" dependencies = [ + "proc-macro-error", "proc-macro2", "quote", "syn", @@ -730,10 +747,11 @@ dependencies = [ [[package]] name = "diesel_migrations" -version = "1.4.0" +version = "2.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bf3cde8413353dc7f5d72fa8ce0b99a560a359d2c5ef1e5817ca731cd9008f4c" +checksum = "e9ae22beef5e9d6fab9225ddb073c1c6c1a7a6ded5019d5da11d1e5c5adc34e2" dependencies = [ + "diesel", "migrations_internals", "migrations_macros", ] @@ -757,9 +775,9 @@ checksum = "212d0f5754cb6769937f4501cc0e67f4f4483c8d2c3e1e922ee9edbe4ab4c7c0" [[package]] name = "either" -version = "1.6.1" +version = "1.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e78d4f1cc4ae33bbfc157ed5d5a5ef3bc29227303d595861deb238fcec4e9457" +checksum = "90e5c1c8368803113bf0c9584fc495a58b86dc8a29edbf8fe877d21d9507e797" [[package]] name = "encoding_rs" @@ -772,26 +790,24 @@ dependencies = [ [[package]] name = "fiat-crypto" -version = "0.1.13" +version = "0.1.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "35354cf6bf9d259374646f419a25c7dd0bb208d291e44dc73db557542fe017fc" +checksum = "70ec9f20e8cd0badcd280ad9be817f0799fe27c45301d096a7e28c9244ad3ace" [[package]] name = "firestorm" -version = "0.5.0" +version = "0.5.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4d3d6188b8804df28032815ea256b6955c9625c24da7525f387a7af02fbb8f01" +checksum = "2c5f6c2c942da57e2aaaa84b8a521489486f14e75e7fa91dab70aba913975f98" [[package]] name = "flate2" -version = "1.0.22" +version = "1.0.24" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1e6988e897c1c9c485f43b47a529cef42fde0547f9d8d41a7062518f1d8fc53f" +checksum = "f82b0f4c27ad9f8bfd1f3208d882da2b09c301bc1c828fd3a00d0216d2fbbff6" dependencies = [ - "cfg-if", "crc32fast", - "libc", - "miniz_oxide 0.4.4", + "miniz_oxide", ] [[package]] @@ -818,15 +834,15 @@ checksum = "2022715d62ab30faffd124d40b76f4134a550a87792276512b18d63272333394" [[package]] name = "futures-core" -version = "0.3.21" +version = "0.3.24" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0c09fd04b7e4073ac7156a9539b57a484a8ea920f79c7c675d05d289ab6110d3" +checksum = "4e5aa3de05362c3fb88de6531e6296e85cde7739cccad4b9dfeeb7f6ebce56bf" [[package]] name = "futures-macro" -version = "0.3.21" +version = "0.3.24" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "33c1e13800337f4d4d7a316bf45a567dbcb6ffe087f16424852d97e97a91f512" +checksum = "42cd15d1c7456c04dbdf7e88bcd69760d74f3a798d6444e16974b505b0e62f17" dependencies = [ "proc-macro2", "quote", @@ -835,21 +851,21 @@ dependencies = [ [[package]] name = "futures-sink" -version = "0.3.21" +version = "0.3.24" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "21163e139fa306126e6eedaf49ecdb4588f939600f0b1e770f4205ee4b7fa868" +checksum = "21b20ba5a92e727ba30e72834706623d94ac93a725410b6a6b6fbc1b07f7ba56" [[package]] name = "futures-task" -version = "0.3.21" +version = "0.3.24" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "57c66a976bf5909d801bbef33416c41372779507e7a6b3a5e25e4749c58f776a" +checksum = "a6508c467c73851293f390476d4491cf4d227dbabcd4170f3bb6044959b294f1" [[package]] name = "futures-util" -version = "0.3.21" +version = "0.3.24" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d8b7abd5d659d9b90c8cba917f6ec750a74e2dc23902ef9cd4cc8c8b22e6036a" +checksum = "44fb6cb1be61cc1d2e43b262516aafcf63b241cffdb1d3fa115f91d9c7b09c90" dependencies = [ "futures-core", "futures-macro", @@ -862,9 +878,9 @@ dependencies = [ [[package]] name = "generic-array" -version = "0.14.5" +version = "0.14.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fd48d33ec7f05fbfa152300fdad764757cbded343c1aa1cff2fbaf4134851803" +checksum = "bff49e947297f3312447abdca79f45f4738097cc82b06e72054d2223f601f1b9" dependencies = [ "typenum", "version_check", @@ -881,20 +897,20 @@ dependencies = [ [[package]] name = "getrandom" -version = "0.2.6" +version = "0.2.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9be70c98951c83b8d2f8f60d7065fa6d5146873094452a1008da8c2f1e4205ad" +checksum = "4eb1a864a501629691edf6c15a593b7a51eebaa1e8468e9ddc623de7c9b58ec6" dependencies = [ "cfg-if", "libc", - "wasi 0.10.2+wasi-snapshot-preview1", + "wasi 0.11.0+wasi-snapshot-preview1", ] [[package]] name = "gif" -version = "0.11.3" +version = "0.11.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c3a7187e78088aead22ceedeee99779455b23fc231fe13ec443f99bb71694e5b" +checksum = "3edd93c6756b4dfaf2709eafcc345ba2636565295c198a9cfbf75fa5e3e00b06" dependencies = [ "color_quant", "weezl", @@ -902,9 +918,9 @@ dependencies = [ [[package]] name = "h2" -version = "0.3.13" +version = "0.3.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "37a82c6d637fc9515a4694bbf1cb2457b79d81ce52b3108bdeea58b07dd34a57" +checksum = "5ca32592cf21ac7ccab1825cd87f6c9b3d9022c44d086172ed0966bec8af30be" dependencies = [ "bytes", "fnv", @@ -921,9 +937,9 @@ dependencies = [ [[package]] name = "hashbrown" -version = "0.11.2" +version = "0.12.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ab5ef0d4909ef3724cc8cce6ccc8572c5c817592e9285f5464f8e86f8bd3726e" +checksum = "8a9ee70c43aaf417c914396645a0fa852624801b24ebb7ae78fe8272889ac888" [[package]] name = "headers" @@ -985,9 +1001,9 @@ dependencies = [ [[package]] name = "http" -version = "0.2.6" +version = "0.2.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "31f4c6746584866f0feabcc69893c5b51beef3831656a968ed7ae254cdc4fd03" +checksum = "75f43d41e26995c17e71ee126451dd3941010b0514a81a9d11f3b341debc2399" dependencies = [ "bytes", "fnv", @@ -1002,9 +1018,9 @@ checksum = "21dec9db110f5f872ed9699c3ecf50cf16f423502706ba5c72462e28d3157573" [[package]] name = "httparse" -version = "1.6.0" +version = "1.7.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9100414882e15fb7feccb4897e5f0ff0ff1ca7d1a86a23208ada4d7a18e6c6c4" +checksum = "496ce29bb5a52785b44e0f7ca2847ae0bb839c9bd28f69acac9b99d461c0c04c" [[package]] name = "httpdate" @@ -1013,10 +1029,23 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c4a1e36c821dbe04574f602848a19f742f4fb3c98d40449f11bcad18d6b17421" [[package]] -name = "id3" -version = "1.0.2" +name = "iana-time-zone" +version = "0.1.46" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7a3598f9ed06d8a7ff358dc1a52f07f98d6625b996ad60588805b3d8cfd4d0cd" +checksum = "ad2bfd338099682614d3ee3fe0cd72e0b6a41ca6a87f6a74a3bd593c91650501" +dependencies = [ + "android_system_properties", + "core-foundation-sys", + "js-sys", + "wasm-bindgen", + "winapi", +] + +[[package]] +name = "id3" +version = "1.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c2cf589c9dddff0ea50b6361b8635720d721d4fbca02861f806add85afef74a0" dependencies = [ "bitflags", "byteorder", @@ -1036,16 +1065,15 @@ dependencies = [ [[package]] name = "image" -version = "0.24.1" +version = "0.24.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "db207d030ae38f1eb6f240d5a1c1c88ff422aa005d10f8c6c6fc5e75286ab30e" +checksum = "7e30ca2ecf7666107ff827a8e481de6a132a9b687ed3bb20bb1c144a36c00964" dependencies = [ "bytemuck", "byteorder", "color_quant", "gif", "jpeg-decoder", - "num-iter", "num-rational", "num-traits", "png", @@ -1053,28 +1081,19 @@ dependencies = [ [[package]] name = "indexmap" -version = "1.8.1" +version = "1.9.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0f647032dfaa1f8b6dc29bd3edb7bbef4861b8b8007ebb118d6db284fd59f6ee" +checksum = "10a35a97730320ffe8e2d410b5d3b69279b98d2c14bdb8b70ea89ecf7888d41e" dependencies = [ "autocfg", "hashbrown", ] -[[package]] -name = "instant" -version = "0.1.12" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7a5bbe824c507c5da5956355e86a746d82e0e1464f65d862cc5e71da70e94b2c" -dependencies = [ - "cfg-if", -] - [[package]] name = "itoa" -version = "1.0.1" +version = "1.0.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1aab8fc367588b89dcee83ab0fd66b72b50b72fa1904d7095045ace2b0c81c35" +checksum = "6c8af84674fe1f223a982c933a0ee1086ac4d4052aa0fb8060c12c6ad838e754" [[package]] name = "jobserver" @@ -1087,15 +1106,15 @@ dependencies = [ [[package]] name = "jpeg-decoder" -version = "0.2.4" +version = "0.2.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "744c24117572563a98a7e9168a5ac1ee4a1ca7f702211258797bbe0ed0346c3c" +checksum = "9478aa10f73e7528198d75109c8be5cd7d15fb530238040148d5f9a22d4c5b3b" [[package]] name = "js-sys" -version = "0.3.57" +version = "0.3.59" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "671a26f820db17c2a2750743f1dd03bafd15b98c9f30c7c2628c024c05d73397" +checksum = "258451ab10b34f8af53416d1fdab72c22e805f0c92a1136d59470ec0b11138b2" dependencies = [ "wasm-bindgen", ] @@ -1125,15 +1144,15 @@ dependencies = [ [[package]] name = "libc" -version = "0.2.122" +version = "0.2.132" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ec647867e2bf0772e28c8bcde4f0d19a9216916e890543b5a03ed8ef27b8f259" +checksum = "8371e4e5341c3a96db127eb2465ac681ced4c433e01dd0e938adbef26ba93ba5" [[package]] name = "libsqlite3-sys" -version = "0.22.2" +version = "0.25.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "290b64917f8b0cb885d9de0f9959fe1f775d7fa12f1da2db9001c1c8ab60f89d" +checksum = "9f0455f2c1bc9a7caa792907026e469c1d91761fb0ea37cbb16427c77280cf35" dependencies = [ "cc", "pkg-config", @@ -1142,9 +1161,9 @@ dependencies = [ [[package]] name = "local-channel" -version = "0.1.2" +version = "0.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6246c68cf195087205a0512559c97e15eaf95198bf0e206d662092cdcb03fe9f" +checksum = "7f303ec0e94c6c54447f84f3b0ef7af769858a9c4ef56ef2a986d3dcd4c3fc9c" dependencies = [ "futures-core", "futures-sink", @@ -1154,15 +1173,15 @@ dependencies = [ [[package]] name = "local-waker" -version = "0.1.2" +version = "0.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "902eb695eb0591864543cbfbf6d742510642a605a61fc5e97fe6ceb5a30ac4fb" +checksum = "e34f76eb3611940e0e7d53a9aaa4e6a3151f69541a282fd0dad5571420c53ff1" [[package]] name = "lock_api" -version = "0.4.7" +version = "0.4.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "327fa5b6a6940e4699ec49a9beae1ea4845c6bab9314e4f84ac68742139d8c53" +checksum = "9f80bf5aacaf25cbfc8210d1cfb718f2bf3b11c4c54e5afe36c236853a8ec390" dependencies = [ "autocfg", "scopeguard", @@ -1170,9 +1189,9 @@ dependencies = [ [[package]] name = "log" -version = "0.4.16" +version = "0.4.17" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6389c490849ff5bc16be905ae24bc913a9c8892e19b2341dbc175e14c341c2b8" +checksum = "abb12e687cfb44aa40f41fc3978ef76448f9b6038cad6aef4259d3c095a2382e" dependencies = [ "cfg-if", ] @@ -1191,9 +1210,9 @@ checksum = "490cc448043f947bae3cbee9c203358d62dbee0db12107a74be5c30ccfd09771" [[package]] name = "memchr" -version = "2.4.1" +version = "2.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "308cc39be01b73d0d18f82a0e7b2a3df85245f84af96fdddc5d202d27e47b86a" +checksum = "2dffe52ecf27772e601905b7522cb4ef790d2cc203488bbd0e2fe85fcb74566d" [[package]] name = "memoffset" @@ -1217,23 +1236,23 @@ dependencies = [ [[package]] name = "migrations_internals" -version = "1.4.1" +version = "2.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2b4fc84e4af020b837029e017966f86a1c2d5e83e64b589963d5047525995860" +checksum = "c493c09323068c01e54c685f7da41a9ccf9219735c3766fbfd6099806ea08fbc" dependencies = [ - "diesel", + "serde", + "toml", ] [[package]] name = "migrations_macros" -version = "1.4.2" +version = "2.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9753f12909fd8d923f75ae5c3258cae1ed3c8ec052e1b38c93c21a6d157f789c" +checksum = "8a8ff27a350511de30cdabb77147501c36ef02e0451d957abea2f30caffb2b58" dependencies = [ "migrations_internals", "proc-macro2", "quote", - "syn", ] [[package]] @@ -1254,44 +1273,23 @@ dependencies = [ [[package]] name = "miniz_oxide" -version = "0.4.4" +version = "0.5.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a92518e98c078586bc6c934028adcca4c92a53d6a958196de835170a01d84e4b" -dependencies = [ - "adler", - "autocfg", -] - -[[package]] -name = "miniz_oxide" -version = "0.5.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d2b29bd4bc3f33391105ebee3589c19197c4271e3e5a9ec9bfe8127eeff8f082" +checksum = "6f5c75688da582b8ffc1f1799e9db273f32133c49e048f614d22ec3256773ccc" dependencies = [ "adler", ] [[package]] name = "mio" -version = "0.8.2" +version = "0.8.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "52da4364ffb0e4fe33a9841a98a3f3014fb964045ce4f7a45a398243c8d6b0c9" +checksum = "57ee1c23c7c63b0c9250c339ffdc69255f110b298b901b9f6c82547b7b87caaf" dependencies = [ "libc", "log", - "miow", - "ntapi", "wasi 0.11.0+wasi-snapshot-preview1", - "winapi", -] - -[[package]] -name = "miow" -version = "0.3.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b9f1c5b025cda876f66ef43a113f91ebc9f4ccef34843000e0adf6ebbab84e21" -dependencies = [ - "winapi", + "windows-sys", ] [[package]] @@ -1321,9 +1319,9 @@ checksum = "07dcca13d1740c0a665f77104803360da0bdb3323ecce2e93fa2c959a6d52806" [[package]] name = "native-windows-derive" -version = "1.0.4" +version = "1.0.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8164b076b08fb63f7cb4da207abe8fd94b5c604e17d9f49618807482dbe25507" +checksum = "76134ae81020d89d154f619fd2495a2cecad204276b1dc21174b55e4d0975edd" dependencies = [ "proc-macro-crate", "proc-macro2", @@ -1343,41 +1341,21 @@ dependencies = [ "winapi-build", ] -[[package]] -name = "ntapi" -version = "0.3.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c28774a7fd2fbb4f0babd8237ce554b73af68021b5f695a3cebd6c59bac0980f" -dependencies = [ - "winapi", -] - [[package]] name = "num-integer" -version = "0.1.44" +version = "0.1.45" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d2cc698a63b549a70bc047073d2949cce27cd1c7b0a4a862d08a8031bc2801db" +checksum = "225d3389fb3509a24c93f5c29eb6bde2586b98d9f016636dff58d7c6f7569cd9" dependencies = [ "autocfg", "num-traits", ] -[[package]] -name = "num-iter" -version = "0.1.42" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b2021c8337a54d21aca0d59a92577a029af9431cb59b909b03252b9c164fad59" -dependencies = [ - "autocfg", - "num-integer", - "num-traits", -] - [[package]] name = "num-rational" -version = "0.4.0" +version = "0.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d41702bd167c2df5520b384281bc111a4b5efcf7fbc4c9c222c815b07e0a6a6a" +checksum = "0638a1c9d0a3c0914158145bc76cff373a75a627e6ecbfb71cbe6f453a5a19b0" dependencies = [ "autocfg", "num-integer", @@ -1386,9 +1364,9 @@ dependencies = [ [[package]] name = "num-traits" -version = "0.2.14" +version = "0.2.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9a64b1ec5cda2586e284722486d802acf1f7dbdc623e2bfc57e65ca1cd099290" +checksum = "578ede34cf02f8924ab9447f50c28075b4d3e5b269972345e7e0372b38c6cdcd" dependencies = [ "autocfg", ] @@ -1405,9 +1383,9 @@ dependencies = [ [[package]] name = "num_threads" -version = "0.1.5" +version = "0.1.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "aba1801fb138d8e85e11d0fc70baf4fe1cdfffda7c6cd34a854905df588e5ed0" +checksum = "2819ce041d2ee131036f4fc9d6ae7ae125a3a40e97ba64d04fe799ad9dabbb44" dependencies = [ "libc", ] @@ -1423,9 +1401,9 @@ dependencies = [ [[package]] name = "once_cell" -version = "1.10.0" +version = "1.13.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "87f3e037eac156d1775da914196f0f37741a274155e34a0b7e427c35d2a2ecb9" +checksum = "074864da206b4973b84eb91683020dbefd6a8c3f0f38e054d93954e891935e4e" [[package]] name = "opus_headers" @@ -1435,9 +1413,9 @@ checksum = "afbb993947f111397c2bc536944f8dac7f54a4e73383d478efe1990b56404b60" [[package]] name = "orion" -version = "0.17.1" +version = "0.17.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0efc4e7f3220d326a2d87d507510b20b0ecd5469f80f6e985dd6fcefa2de9af1" +checksum = "dd6b8920e5d7662ee0578a19b322ff34ff56009e4c3730e2f90d75760002bfc9" dependencies = [ "ct-codecs", "fiat-crypto", @@ -1448,44 +1426,19 @@ dependencies = [ [[package]] name = "parking_lot" -version = "0.11.2" +version = "0.12.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7d17b78036a60663b797adeaee46f5c9dfebb86948d1255007a1d6be0271ff99" -dependencies = [ - "instant", - "lock_api", - "parking_lot_core 0.8.5", -] - -[[package]] -name = "parking_lot" -version = "0.12.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "87f5ec2493a61ac0506c0f4199f99070cbe83857b0337006a30f3e6719b8ef58" +checksum = "3742b2c103b9f06bc9fff0a37ff4912935851bee6d36f3c02bcc755bcfec228f" dependencies = [ "lock_api", - "parking_lot_core 0.9.2", + "parking_lot_core", ] [[package]] name = "parking_lot_core" -version = "0.8.5" +version = "0.9.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d76e8e1493bcac0d2766c42737f34458f1c8c50c0d23bcb24ea953affb273216" -dependencies = [ - "cfg-if", - "instant", - "libc", - "redox_syscall", - "smallvec", - "winapi", -] - -[[package]] -name = "parking_lot_core" -version = "0.9.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "995f667a6c822200b0433ac218e05582f0e2efa1b922a3fd2fbaadc5f87bab37" +checksum = "09a279cbf25cb0757810394fbc1e359949b59e348145c643a939a525692e6929" dependencies = [ "cfg-if", "libc", @@ -1496,9 +1449,9 @@ dependencies = [ [[package]] name = "password-hash" -version = "0.4.0" +version = "0.4.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "aa26fd5c3cd6e6bb83dd9c0cef40fbeb77d7596339ca46c18a6f66919bb07769" +checksum = "7676374caaee8a325c9e7a2ae557f216c5563a171d6997b0ef8a65af35147700" dependencies = [ "base64ct", "rand_core", @@ -1507,9 +1460,9 @@ dependencies = [ [[package]] name = "paste" -version = "1.0.7" +version = "1.0.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0c520e05135d6e763148b6426a837e239041653ba7becd2e538c076c738025fc" +checksum = "9423e2b32f7a043629287a536f21951e8c6a82482d0acb1eeebfc90bc2225b22" [[package]] name = "pbkdf2" @@ -1531,9 +1484,9 @@ checksum = "d4fd5641d01c8f18a23da7b6fe29298ff4b55afcccdf78973b24cf3175fee32e" [[package]] name = "pin-project-lite" -version = "0.2.8" +version = "0.2.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e280fbe77cc62c91527259e9442153f4688736748d24660126286329742b4c6c" +checksum = "e0a7ae3ac2f1173085d398531c705756c94a4c56843785df85a60c1a0afac116" [[package]] name = "pin-utils" @@ -1556,7 +1509,7 @@ dependencies = [ "bitflags", "crc32fast", "deflate", - "miniz_oxide 0.5.1", + "miniz_oxide", ] [[package]] @@ -1627,6 +1580,30 @@ dependencies = [ "toml", ] +[[package]] +name = "proc-macro-error" +version = "1.0.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "da25490ff9892aab3fcf7c36f08cfb902dd3e71ca0f9f9517bea02a73a5ce38c" +dependencies = [ + "proc-macro-error-attr", + "proc-macro2", + "quote", + "syn", + "version_check", +] + +[[package]] +name = "proc-macro-error-attr" +version = "1.0.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a1be40180e52ecc98ad80b184934baf3d0d29f979574e439af5a55274b35f869" +dependencies = [ + "proc-macro2", + "quote", + "version_check", +] + [[package]] name = "proc-macro-hack" version = "0.5.19" @@ -1635,11 +1612,11 @@ checksum = "dbf0c48bc1d91375ae5c3cd81e3722dff1abcf81a30960240640d223f59fe0e5" [[package]] name = "proc-macro2" -version = "1.0.37" +version = "1.0.43" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ec757218438d5fda206afc041538b2f6d889286160d649a86a24d37e1235afd1" +checksum = "0a2ca2c61bc9f3d74d2886294ab7b9853abd9c1ad903a3ac7815c58989bb7bab" dependencies = [ - "unicode-xid", + "unicode-ident", ] [[package]] @@ -1663,21 +1640,21 @@ dependencies = [ [[package]] name = "quote" -version = "1.0.18" +version = "1.0.21" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a1feb54ed693b93a84e14094943b84b7c4eae204c512b7ccb95ab0c66d278ad1" +checksum = "bbe448f377a7d6961e30f5955f9b8d106c3f5e449d493ee1b125c1d43c2b5179" dependencies = [ "proc-macro2", ] [[package]] name = "r2d2" -version = "0.8.9" +version = "0.8.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "545c5bc2b880973c9c10e4067418407a0ccaa3091781d1671d46eb35107cb26f" +checksum = "51de85fb3fb6524929c8a2eb85e6b6d363de4e8c48f9e2c2eac4944abc181c93" dependencies = [ "log", - "parking_lot 0.11.2", + "parking_lot", "scheduled-thread-pool", ] @@ -1713,9 +1690,9 @@ dependencies = [ [[package]] name = "rayon" -version = "1.5.1" +version = "1.5.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c06aca804d41dbc8ba42dfd964f0d01334eceb64314b9ecf7c5fad5188a06d90" +checksum = "bd99e5772ead8baa5215278c9b15bf92087709e9c1b2d1f97cdb5a183c933a7d" dependencies = [ "autocfg", "crossbeam-deque", @@ -1725,31 +1702,30 @@ dependencies = [ [[package]] name = "rayon-core" -version = "1.9.1" +version = "1.9.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d78120e2c850279833f1dd3582f730c4ab53ed95aeaaaa862a2a5c71b1656d8e" +checksum = "258bcdb5ac6dad48491bb2992db6b7cf74878b0384908af124823d118c99683f" dependencies = [ "crossbeam-channel", "crossbeam-deque", "crossbeam-utils", - "lazy_static", "num_cpus", ] [[package]] name = "redox_syscall" -version = "0.2.13" +version = "0.2.16" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "62f25bc4c7e55e0b0b7a1d43fb893f4fa1361d0abe38b9ce4f323c2adfe6ef42" +checksum = "fb5a58c1855b4b6819d59012155603f0b22ad30cad752600aadfcb695265519a" dependencies = [ "bitflags", ] [[package]] name = "regex" -version = "1.5.5" +version = "1.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1a11647b6b25ff05a515cb92c365cec08801e83423a235b51e231e1808747286" +checksum = "4c4eb3267174b8c6c2f654116623910a0fef09c4753f8dd83db29c48a0df988b" dependencies = [ "aho-corasick", "memchr", @@ -1758,9 +1734,9 @@ dependencies = [ [[package]] name = "regex-syntax" -version = "0.6.25" +version = "0.6.27" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f497285884f3fcff424ffc933e56d7cbca511def0c9831a7f9b5f6153e3cc89b" +checksum = "a3f87b73ce11b1619a3c6332f45341e0047173771e8b8b73f87bfeefb7b56244" [[package]] name = "ring" @@ -1792,7 +1768,7 @@ version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "bfa0f585226d2e68097d4f95d113b15b83a82e819ab25717ec0590d9584ef366" dependencies = [ - "semver 1.0.7", + "semver 1.0.13", ] [[package]] @@ -1823,17 +1799,17 @@ dependencies = [ [[package]] name = "ryu" -version = "1.0.9" +version = "1.0.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "73b4b750c782965c211b42f022f59af1fbceabdd026623714f104152f1ec149f" +checksum = "4501abdff3ae82a1c1b477a17252eb69cee9e66eb915c1abaa4f44d873df9f09" [[package]] name = "scheduled-thread-pool" -version = "0.2.5" +version = "0.2.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dc6f74fd1204073fa02d5d5d68bec8021be4c38690b61264b2fdb48083d0e7d7" +checksum = "977a7519bff143a44f842fd07e80ad1329295bd71686457f18e496736f4bf9bf" dependencies = [ - "parking_lot 0.11.2", + "parking_lot", ] [[package]] @@ -1869,9 +1845,9 @@ dependencies = [ [[package]] name = "semver" -version = "1.0.7" +version = "1.0.13" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d65bd28f48be7196d222d95b9243287f48d27aca604e08497513019ff0502cc4" +checksum = "93f6841e709003d68bb2deee8c343572bf446003ec20a583e76f7b15cebf3711" [[package]] name = "semver-parser" @@ -1881,18 +1857,18 @@ checksum = "388a1df253eca08550bef6c72392cfe7c30914bf41df5269b68cbd6ff8f570a3" [[package]] name = "serde" -version = "1.0.136" +version = "1.0.144" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ce31e24b01e1e524df96f1c2fdd054405f8d7376249a5110886fb4b658484789" +checksum = "0f747710de3dcd43b88c9168773254e809d8ddbdf9653b84e2554ab219f17860" dependencies = [ "serde_derive", ] [[package]] name = "serde_derive" -version = "1.0.136" +version = "1.0.144" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "08597e7152fcd306f41838ed3e37be9eaeed2b61c42e2117266a554fab4662f9" +checksum = "94ed3a816fb1d101812f83e789f888322c34e291f894f19590dc310963e87a00" dependencies = [ "proc-macro2", "quote", @@ -1901,9 +1877,9 @@ dependencies = [ [[package]] name = "serde_json" -version = "1.0.79" +version = "1.0.85" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8e8d9fa5c3b304765ce1fd9c4c8a3de2c8db365a5b91be52f186efc675681d95" +checksum = "e55a28e3aaef9d5ce0506d0a14dbba8054ddc7e499ef522dd8b26859ec9d4a44" dependencies = [ "itoa", "ryu", @@ -1942,6 +1918,17 @@ dependencies = [ "sha1_smol", ] +[[package]] +name = "sha1" +version = "0.10.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c77f4e7f65455545c2153c1253d25056825e77ee2533f0e41deb65a93a34852f" +dependencies = [ + "cfg-if", + "cpufeatures", + "digest", +] + [[package]] name = "sha1_smol" version = "1.0.0" @@ -1981,21 +1968,24 @@ dependencies = [ [[package]] name = "slab" -version = "0.4.6" +version = "0.4.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "eb703cfe953bccee95685111adeedb76fabe4e97549a58d16f03ea7b9367bb32" +checksum = "4614a76b2a8be0058caa9dbbaf66d988527d86d003c11a94fbd335d7661edcef" +dependencies = [ + "autocfg", +] [[package]] name = "smallvec" -version = "1.8.0" +version = "1.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f2dd574626839106c320a323308629dcb1acfc96e32a8cba364ddc61ac23ee83" +checksum = "2fd0db749597d91ff862fd1d55ea87f7855a744a8425a64695b6fca237d1dad1" [[package]] name = "socket2" -version = "0.4.4" +version = "0.4.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "66d72b759436ae32898a2af0a14218dbf55efde3feeb170eb623637db85ee1e0" +checksum = "10c98bba371b9b22a71a9414e420f92ddeb2369239af08200816169d5e2dd7aa" dependencies = [ "libc", "winapi", @@ -2055,7 +2045,7 @@ dependencies = [ "serde", "serde_derive", "serde_json", - "sha1", + "sha1 0.6.1", "syn", ] @@ -2073,13 +2063,13 @@ checksum = "6bdef32e8150c2a081110b42772ffe7d7c9032b606bc226c8260fd97e0976601" [[package]] name = "syn" -version = "1.0.91" +version = "1.0.99" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b683b2b825c8eef438b77c36a06dc262294da3d5a5813fac20da149241dcd44d" +checksum = "58dbef6ec655055e20b86b15a8cc6d439cca19b667537ac6a1369572d151ab13" dependencies = [ "proc-macro2", "quote", - "unicode-xid", + "unicode-ident", ] [[package]] @@ -2093,18 +2083,18 @@ dependencies = [ [[package]] name = "thiserror" -version = "1.0.30" +version = "1.0.32" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "854babe52e4df1653706b98fcfc05843010039b406875930a70e4d9644e5c417" +checksum = "f5f6586b7f764adc0231f4c79be7b920e766bb2f3e51b3661cdb263828f19994" dependencies = [ "thiserror-impl", ] [[package]] name = "thiserror-impl" -version = "1.0.30" +version = "1.0.32" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "aa32fd3f627f367fe16f893e2597ae3c05020f8bba2666a4e6ea73d377e5714b" +checksum = "12bafc5b54507e0149cdf1b145a5d80ab80a90bcd9275df43d4fff68460f6c21" dependencies = [ "proc-macro2", "quote", @@ -2113,11 +2103,12 @@ dependencies = [ [[package]] name = "time" -version = "0.1.43" +version = "0.1.44" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ca8a50ef2360fbd1eeb0ecd46795a87a19024eb4b53c5dc916ca1fd95fe62438" +checksum = "6db9e6914ab8b1ae1c260a4ae7a49b6c5611b40328a735b21862567685e73255" dependencies = [ "libc", + "wasi 0.10.0+wasi-snapshot-preview1", "winapi", ] @@ -2138,9 +2129,9 @@ dependencies = [ [[package]] name = "time" -version = "0.3.9" +version = "0.3.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c2702e08a7a860f005826c6815dcac101b19b5eb330c27fe4a5928fec1d20ddd" +checksum = "3c3f9a28b618c3a6b9251b6908e9c99e04b9e5c02e6581ccbb67d59c34ef7f9b" dependencies = [ "itoa", "libc", @@ -2179,9 +2170,9 @@ dependencies = [ [[package]] name = "tinyvec" -version = "1.5.1" +version = "1.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2c1c1d5a42b6245520c249549ec267180beaffcc0615401ac8e31853d4b6d8d2" +checksum = "87cc5ceb3875bb20c2890005a4e226a4651264a5c75edb2421b52861a0a0cb50" dependencies = [ "tinyvec_macros", ] @@ -2194,16 +2185,17 @@ checksum = "cda74da7e1a664f795bb1f8a87ec406fb89a02522cf6e50620d016add6dbbf5c" [[package]] name = "tokio" -version = "1.17.0" +version = "1.20.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2af73ac49756f3f7c01172e34a23e5d0216f6c32333757c2c61feb2bbff5a5ee" +checksum = "7a8325f63a7d4774dd041e363b2409ed1c5cbbd0f867795e661df066b2b0a581" dependencies = [ + "autocfg", "bytes", "libc", "memchr", "mio", "once_cell", - "parking_lot 0.12.0", + "parking_lot", "pin-project-lite", "signal-hook-registry", "socket2", @@ -2212,9 +2204,9 @@ dependencies = [ [[package]] name = "tokio-util" -version = "0.7.1" +version = "0.7.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0edfdeb067411dba2044da6d1cb2df793dd35add7888d73c16e3381ded401764" +checksum = "cc463cd8deddc3770d20f9852143d50bf6094e640b485cb2e189a2099085ff45" dependencies = [ "bytes", "futures-core", @@ -2226,44 +2218,32 @@ dependencies = [ [[package]] name = "toml" -version = "0.5.8" +version = "0.5.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a31142970826733df8241ef35dc040ef98c679ab14d7c3e54d827099b3acecaa" +checksum = "8d82e1a7758622a465f8cee077614c73484dac5b836c02ff6a40d5d1010324d7" dependencies = [ "serde", ] [[package]] name = "tracing" -version = "0.1.33" +version = "0.1.36" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "80b9fa4360528139bc96100c160b7ae879f5567f49f1782b0b02035b0358ebf3" +checksum = "2fce9567bd60a67d08a16488756721ba392f24f29006402881e43b19aac64307" dependencies = [ "cfg-if", "log", "pin-project-lite", - "tracing-attributes", "tracing-core", ] -[[package]] -name = "tracing-attributes" -version = "0.1.20" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2e65ce065b4b5c53e73bb28912318cb8c9e9ad3921f1d669eb0e68b4c8143a2b" -dependencies = [ - "proc-macro2", - "quote", - "syn", -] - [[package]] name = "tracing-core" -version = "0.1.24" +version = "0.1.29" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "90442985ee2f57c9e1b548ee72ae842f4a9a20e3f417cc38dbc5dc684d9bb4ee" +checksum = "5aeea4303076558a00714b823f9ad67d58a3bbda1df83d8827d21193156e22f7" dependencies = [ - "lazy_static", + "once_cell", ] [[package]] @@ -2283,15 +2263,21 @@ dependencies = [ [[package]] name = "unicode-bidi" -version = "0.3.7" +version = "0.3.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1a01404663e3db436ed2746d9fefef640d868edae3cceb81c3b8d5732fda678f" +checksum = "099b7128301d285f79ddd55b9a83d5e6b9e97c92e0ea0daebee7263e932de992" + +[[package]] +name = "unicode-ident" +version = "1.0.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c4f5b37a154999a8f3f98cc23a628d850e154479cd94decf3414696e12e31aaf" [[package]] name = "unicode-normalization" -version = "0.1.19" +version = "0.1.21" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d54590932941a9e9266f0832deed84ebe1bf2e4c9e4a3554d393d18f5e854bf9" +checksum = "854cbdc4f7bc6ae19c820d44abdc3277ac3e1b2b93db20a636825d9322fb60e6" dependencies = [ "tinyvec", ] @@ -2302,12 +2288,6 @@ version = "0.1.9" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3ed742d4ea2bd1176e236172c8429aaf54486e7ac098db29ffe6529e0ce50973" -[[package]] -name = "unicode-xid" -version = "0.2.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8ccb82d61f80a663efe1f787a51b16b5a51e3314d6ac365b08639f52387b33f3" - [[package]] name = "untrusted" version = "0.7.1" @@ -2359,9 +2339,9 @@ checksum = "49874b5167b65d7193b8aba1567f5c7d93d001cafc34600cee003eda787e483f" [[package]] name = "wasi" -version = "0.10.2+wasi-snapshot-preview1" +version = "0.10.0+wasi-snapshot-preview1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fd6fbd9a79829dd1ad0cc20627bf1ed606756a7f77edff7b66b7064f9cb327c6" +checksum = "1a143597ca7c7793eff794def352d41792a93c481eb1042423ff7ff72ba2c31f" [[package]] name = "wasi" @@ -2371,9 +2351,9 @@ checksum = "9c8d87e72b64a3b4db28d11ce29237c246188f4f51057d65a7eab63b7987e423" [[package]] name = "wasm-bindgen" -version = "0.2.80" +version = "0.2.82" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "27370197c907c55e3f1a9fbe26f44e937fe6451368324e009cba39e139dc08ad" +checksum = "fc7652e3f6c4706c8d9cd54832c4a4ccb9b5336e2c3bd154d5cccfbf1c1f5f7d" dependencies = [ "cfg-if", "wasm-bindgen-macro", @@ -2381,13 +2361,13 @@ dependencies = [ [[package]] name = "wasm-bindgen-backend" -version = "0.2.80" +version = "0.2.82" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "53e04185bfa3a779273da532f5025e33398409573f348985af9a1cbf3774d3f4" +checksum = "662cd44805586bd52971b9586b1df85cdbbd9112e4ef4d8f41559c334dc6ac3f" dependencies = [ "bumpalo", - "lazy_static", "log", + "once_cell", "proc-macro2", "quote", "syn", @@ -2396,9 +2376,9 @@ dependencies = [ [[package]] name = "wasm-bindgen-macro" -version = "0.2.80" +version = "0.2.82" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "17cae7ff784d7e83a2fe7611cfe766ecf034111b49deb850a3dc7699c08251f5" +checksum = "b260f13d3012071dfb1512849c033b1925038373aea48ced3012c09df952c602" dependencies = [ "quote", "wasm-bindgen-macro-support", @@ -2406,9 +2386,9 @@ dependencies = [ [[package]] name = "wasm-bindgen-macro-support" -version = "0.2.80" +version = "0.2.82" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "99ec0dc7a4756fffc231aab1b9f2f578d23cd391390ab27f952ae0c9b3ece20b" +checksum = "5be8e654bdd9b79216c2929ab90721aa82faf65c48cdf08bdc4e7f51357b80da" dependencies = [ "proc-macro2", "quote", @@ -2419,15 +2399,15 @@ dependencies = [ [[package]] name = "wasm-bindgen-shared" -version = "0.2.80" +version = "0.2.82" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d554b7f530dee5964d9a9468d95c1f8b8acae4f282807e7d27d4b03099a46744" +checksum = "6598dd0bd3c7d51095ff6531a5b23e02acdc81804e30d8f07afb77b7215a140a" [[package]] name = "web-sys" -version = "0.3.57" +version = "0.3.59" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7b17e741662c70c8bd24ac5c5b18de314a2c26c32bf8346ee1e6f53de919c283" +checksum = "ed055ab27f941423197eb86b2035720b1a3ce40504df082cac2ecc6ed73335a1" dependencies = [ "js-sys", "wasm-bindgen", @@ -2454,9 +2434,9 @@ dependencies = [ [[package]] name = "weezl" -version = "0.1.5" +version = "0.1.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d8b77fdfd5a253be4ab714e4ffa3c49caf146b4de743e97510c0656cf90f1e8e" +checksum = "9193164d4de03a926d909d3bc7c30543cecb35400c02114792c2cae20d5e2dbb" [[package]] name = "winapi" @@ -2497,9 +2477,9 @@ checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" [[package]] name = "windows-sys" -version = "0.34.0" +version = "0.36.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5acdd78cb4ba54c0045ac14f62d8f94a03d10047904ae2a40afa1e99d8f70825" +checksum = "ea04155a16a59f9eab786fe12a4a450e75cdb175f9e0d80da1e17db09f55b8d2" dependencies = [ "windows_aarch64_msvc", "windows_i686_gnu", @@ -2510,33 +2490,33 @@ dependencies = [ [[package]] name = "windows_aarch64_msvc" -version = "0.34.0" +version = "0.36.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "17cffbe740121affb56fad0fc0e421804adf0ae00891205213b5cecd30db881d" +checksum = "9bb8c3fd39ade2d67e9874ac4f3db21f0d710bee00fe7cab16949ec184eeaa47" [[package]] name = "windows_i686_gnu" -version = "0.34.0" +version = "0.36.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2564fde759adb79129d9b4f54be42b32c89970c18ebf93124ca8870a498688ed" +checksum = "180e6ccf01daf4c426b846dfc66db1fc518f074baa793aa7d9b9aaeffad6a3b6" [[package]] name = "windows_i686_msvc" -version = "0.34.0" +version = "0.36.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9cd9d32ba70453522332c14d38814bceeb747d80b3958676007acadd7e166956" +checksum = "e2e7917148b2812d1eeafaeb22a97e4813dfa60a3f8f78ebe204bcc88f12f024" [[package]] name = "windows_x86_64_gnu" -version = "0.34.0" +version = "0.36.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cfce6deae227ee8d356d19effc141a509cc503dfd1f850622ec4b0f84428e1f4" +checksum = "4dcd171b8776c41b97521e5da127a2d86ad280114807d0b2ab1e462bc764d9e1" [[package]] name = "windows_x86_64_msvc" -version = "0.34.0" +version = "0.36.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d19538ccc21819d01deaf88d6a17eae6596a12e9aafdbb97916fb49896d89de9" +checksum = "c811ca4a8c853ef420abd8592ba53ddbbac90410fab6903b3e79972a631f7680" [[package]] name = "winres" @@ -2560,24 +2540,24 @@ dependencies = [ [[package]] name = "zeroize" -version = "1.5.4" +version = "1.5.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7eb5728b8afd3f280a869ce1d4c554ffaed35f45c231fc41bfbd0381bef50317" +checksum = "c394b5bd0c6f669e7275d9c20aa90ae064cb22e75a1cad54e1b34088034b149f" [[package]] name = "zstd" -version = "0.10.0+zstd.1.5.2" +version = "0.11.2+zstd.1.5.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3b1365becbe415f3f0fcd024e2f7b45bacfb5bdd055f0dc113571394114e7bdd" +checksum = "20cc960326ece64f010d2d2107537f26dc589a6573a316bd5b1dba685fa5fde4" dependencies = [ "zstd-safe", ] [[package]] name = "zstd-safe" -version = "4.1.4+zstd.1.5.2" +version = "5.0.2+zstd.1.5.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2f7cd17c9af1a4d6c24beb1cc54b17e2ef7b593dc92f19e9d9acad8b182bbaee" +checksum = "1d2a5585e04f9eea4b2a3d1eca508c4dee9592a89ef6f450c11719da0726f4db" dependencies = [ "libc", "zstd-sys", @@ -2585,9 +2565,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/Cargo.toml b/Cargo.toml index 8233116..5708399 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -21,13 +21,13 @@ base64 = "0.13" branca = "0.10.1" cookie = { version = "0.16", features = ["signed", "key-expansion"] } crossbeam-channel = "0.5" -diesel_migrations = { version = "1.4", features = ["sqlite"] } +diesel_migrations = { version = "2.0", features = ["sqlite"] } futures-util = { version = "0.3" } getopts = "0.2.21" http = "0.2.6" id3 = "1.0.2" lewton = "0.10.2" -libsqlite3-sys = { version = "0.22", features = ["bundled", "bundled-windows"], optional = true } +libsqlite3-sys = { version = "0.25", features = ["bundled", "bundled-windows"], optional = true } log = "0.4.14" metaflac = "0.2.5" mp3-duration = "0.1.10" @@ -51,7 +51,7 @@ ureq = "1.5.5" url = "2.2" [dependencies.diesel] -version = "1.4.8" +version = "2.0.0" default_features = false features = ["libsqlite3-sys", "r2d2", "sqlite", "64-column-tables"] diff --git a/src/app/ddns/config.rs b/src/app/ddns/config.rs index 1973024..64c6bf2 100644 --- a/src/app/ddns/config.rs +++ b/src/app/ddns/config.rs @@ -3,7 +3,7 @@ use serde::{Deserialize, Serialize}; use crate::db::ddns_config; #[derive(Clone, Debug, Deserialize, Insertable, PartialEq, Eq, Queryable, Serialize)] -#[table_name = "ddns_config"] +#[diesel(table_name = ddns_config)] pub struct Config { pub host: String, pub username: String, diff --git a/src/app/ddns/manager.rs b/src/app/ddns/manager.rs index fd14fcb..ea890a2 100644 --- a/src/app/ddns/manager.rs +++ b/src/app/ddns/manager.rs @@ -43,22 +43,22 @@ impl Manager { pub fn config(&self) -> Result { use crate::db::ddns_config::dsl::*; - let connection = self.db.connect()?; + let mut connection = self.db.connect()?; Ok(ddns_config .select((host, username, password)) - .get_result(&connection)?) + .get_result(&mut connection)?) } pub fn set_config(&self, new_config: &Config) -> Result<()> { use crate::db::ddns_config::dsl::*; - let connection = self.db.connect()?; + let mut connection = self.db.connect()?; diesel::update(ddns_config) .set(( host.eq(&new_config.host), username.eq(&new_config.username), password.eq(&new_config.password), )) - .execute(&connection)?; + .execute(&mut connection)?; Ok(()) } diff --git a/src/app/index/query.rs b/src/app/index/query.rs index 82b4729..9d2e9b2 100644 --- a/src/app/index/query.rs +++ b/src/app/index/query.rs @@ -21,10 +21,9 @@ impl From for QueryError { } } -no_arg_sql_function!( - random, - sql_types::Integer, - "Represents the SQL RANDOM() function" +sql_function!( + #[aggregate] + fn random() -> Integer; ); impl Index { @@ -34,13 +33,13 @@ impl Index { { let mut output = Vec::new(); let vfs = self.vfs_manager.get_vfs()?; - let connection = self.db.connect()?; + let mut connection = self.db.connect()?; if virtual_path.as_ref().components().count() == 0 { // Browse top-level let real_directories: Vec = directories::table .filter(directories::parent.is_null()) - .load(&connection) + .load(&mut connection) .map_err(anyhow::Error::new)?; let virtual_directories = real_directories .into_iter() @@ -56,7 +55,7 @@ impl Index { let real_directories: Vec = directories::table .filter(directories::parent.eq(&real_path_string)) .order(sql::("path COLLATE NOCASE ASC")) - .load(&connection) + .load(&mut connection) .map_err(anyhow::Error::new)?; let virtual_directories = real_directories .into_iter() @@ -66,7 +65,7 @@ impl Index { let real_songs: Vec = songs::table .filter(songs::parent.eq(&real_path_string)) .order(sql::("path COLLATE NOCASE ASC")) - .load(&connection) + .load(&mut connection) .map_err(anyhow::Error::new)?; let virtual_songs = real_songs.into_iter().filter_map(|s| s.virtualize(&vfs)); output.extend(virtual_songs.map(CollectionFile::Song)); @@ -81,7 +80,7 @@ impl Index { { use self::songs::dsl::*; let vfs = self.vfs_manager.get_vfs()?; - let connection = self.db.connect()?; + let mut connection = self.db.connect()?; let real_songs: Vec = if virtual_path.as_ref().parent() != None { let real_path = vfs @@ -95,12 +94,12 @@ impl Index { songs .filter(path.like(&song_path_filter)) .order(path) - .load(&connection) + .load(&mut connection) .map_err(anyhow::Error::new)? } else { songs .order(path) - .load(&connection) + .load(&mut connection) .map_err(anyhow::Error::new)? }; @@ -111,12 +110,12 @@ impl Index { pub fn get_random_albums(&self, count: i64) -> anyhow::Result> { use self::directories::dsl::*; let vfs = self.vfs_manager.get_vfs()?; - let connection = self.db.connect()?; + let mut connection = self.db.connect()?; let real_directories: Vec = directories .filter(album.is_not_null()) .limit(count) - .order(random) - .load(&connection)?; + .order(random()) + .load(&mut connection)?; let virtual_directories = real_directories .into_iter() .filter_map(|d| d.virtualize(&vfs)); @@ -126,12 +125,12 @@ impl Index { pub fn get_recent_albums(&self, count: i64) -> anyhow::Result> { use self::directories::dsl::*; let vfs = self.vfs_manager.get_vfs()?; - let connection = self.db.connect()?; + let mut connection = self.db.connect()?; let real_directories: Vec = directories .filter(album.is_not_null()) .order(date_added.desc()) .limit(count) - .load(&connection)?; + .load(&mut connection)?; let virtual_directories = real_directories .into_iter() .filter_map(|d| d.virtualize(&vfs)); @@ -140,7 +139,7 @@ impl Index { pub fn search(&self, query: &str) -> anyhow::Result> { let vfs = self.vfs_manager.get_vfs()?; - let connection = self.db.connect()?; + let mut connection = self.db.connect()?; let like_test = format!("%{}%", query); let mut output = Vec::new(); @@ -150,7 +149,7 @@ impl Index { let real_directories: Vec = directories .filter(path.like(&like_test)) .filter(parent.not_like(&like_test)) - .load(&connection)?; + .load(&mut connection)?; let virtual_directories = real_directories .into_iter() @@ -171,7 +170,7 @@ impl Index { .or(album_artist.like(&like_test)), ) .filter(parent.not_like(&like_test)) - .load(&connection)?; + .load(&mut connection)?; let virtual_songs = real_songs.into_iter().filter_map(|d| d.virtualize(&vfs)); @@ -183,7 +182,7 @@ impl Index { pub fn get_song(&self, virtual_path: &Path) -> anyhow::Result { let vfs = self.vfs_manager.get_vfs()?; - let connection = self.db.connect()?; + let mut connection = self.db.connect()?; let real_path = vfs.virtual_to_real(virtual_path)?; let real_path_string = real_path.as_path().to_string_lossy(); @@ -191,7 +190,7 @@ impl Index { use self::songs::dsl::*; let real_song: Song = songs .filter(path.eq(real_path_string)) - .get_result(&connection)?; + .get_result(&mut connection)?; match real_song.virtualize(&vfs) { Some(s) => Ok(s), diff --git a/src/app/index/test.rs b/src/app/index/test.rs index 8ebc3a4..49c2b04 100644 --- a/src/app/index/test.rs +++ b/src/app/index/test.rs @@ -18,9 +18,9 @@ fn update_adds_new_content() { ctx.index.update().unwrap(); ctx.index.update().unwrap(); // Validates that subsequent updates don't run into conflicts - let connection = ctx.db.connect().unwrap(); - let all_directories: Vec = directories::table.load(&connection).unwrap(); - let all_songs: Vec = songs::table.load(&connection).unwrap(); + let mut connection = ctx.db.connect().unwrap(); + let all_directories: Vec = directories::table.load(&mut connection).unwrap(); + let all_songs: Vec = songs::table.load(&mut connection).unwrap(); assert_eq!(all_directories.len(), 6); assert_eq!(all_songs.len(), 13); } @@ -47,9 +47,9 @@ fn update_removes_missing_content() { ctx.index.update().unwrap(); { - let connection = ctx.db.connect().unwrap(); - let all_directories: Vec = directories::table.load(&connection).unwrap(); - let all_songs: Vec = songs::table.load(&connection).unwrap(); + let mut connection = ctx.db.connect().unwrap(); + let all_directories: Vec = directories::table.load(&mut connection).unwrap(); + let all_songs: Vec = songs::table.load(&mut connection).unwrap(); assert_eq!(all_directories.len(), 6); assert_eq!(all_songs.len(), 13); } @@ -58,9 +58,9 @@ fn update_removes_missing_content() { std::fs::remove_dir_all(&khemmis_directory).unwrap(); ctx.index.update().unwrap(); { - let connection = ctx.db.connect().unwrap(); - let all_directories: Vec = directories::table.load(&connection).unwrap(); - let all_songs: Vec = songs::table.load(&connection).unwrap(); + let mut connection = ctx.db.connect().unwrap(); + let all_directories: Vec = directories::table.load(&mut connection).unwrap(); + let all_songs: Vec = songs::table.load(&mut connection).unwrap(); assert_eq!(all_directories.len(), 4); assert_eq!(all_songs.len(), 8); } diff --git a/src/app/index/types.rs b/src/app/index/types.rs index f19c42e..427cf90 100644 --- a/src/app/index/types.rs +++ b/src/app/index/types.rs @@ -11,7 +11,7 @@ pub enum CollectionFile { } #[derive(Debug, PartialEq, Eq, Queryable, QueryableByName, Serialize, Deserialize)] -#[table_name = "songs"] +#[diesel(table_name = songs)] pub struct Song { #[serde(skip_serializing, skip_deserializing)] id: i32, diff --git a/src/app/index/update/cleaner.rs b/src/app/index/update/cleaner.rs index 96fc99a..83fed36 100644 --- a/src/app/index/update/cleaner.rs +++ b/src/app/index/update/cleaner.rs @@ -22,15 +22,15 @@ impl Cleaner { let vfs = self.vfs_manager.get_vfs()?; let all_directories: Vec = { - let connection = self.db.connect()?; + let mut connection = self.db.connect()?; directories::table .select(directories::path) - .load(&connection)? + .load(&mut connection)? }; let all_songs: Vec = { - let connection = self.db.connect()?; - songs::table.select(songs::path).load(&connection)? + let mut connection = self.db.connect()?; + songs::table.select(songs::path).load(&mut connection)? }; let list_missing_directories = || { @@ -58,14 +58,14 @@ impl Cleaner { thread_pool.join(list_missing_directories, list_missing_songs); { - let connection = self.db.connect()?; + let mut connection = self.db.connect()?; for chunk in missing_directories[..].chunks(INDEX_BUILDING_CLEAN_BUFFER_SIZE) { diesel::delete(directories::table.filter(directories::path.eq_any(chunk))) - .execute(&connection)?; + .execute(&mut connection)?; } for chunk in missing_songs[..].chunks(INDEX_BUILDING_CLEAN_BUFFER_SIZE) { diesel::delete(songs::table.filter(songs::path.eq_any(chunk))) - .execute(&connection)?; + .execute(&mut connection)?; } } diff --git a/src/app/index/update/inserter.rs b/src/app/index/update/inserter.rs index 9d517ff..6fffd15 100644 --- a/src/app/index/update/inserter.rs +++ b/src/app/index/update/inserter.rs @@ -8,7 +8,7 @@ use crate::db::{directories, songs, DB}; const INDEX_BUILDING_INSERT_BUFFER_SIZE: usize = 1000; // Insertions in each transaction #[derive(Debug, Insertable)] -#[table_name = "songs"] +#[diesel(table_name = songs)] pub struct Song { pub path: String, pub parent: String, @@ -28,7 +28,7 @@ pub struct Song { } #[derive(Debug, Insertable)] -#[table_name = "directories"] +#[diesel(table_name = directories)] pub struct Directory { pub path: String, pub parent: Option, @@ -87,10 +87,10 @@ impl Inserter { } fn flush_directories(&mut self) { - let res = self.db.connect().and_then(|connection| { + let res = self.db.connect().and_then(|mut connection| { diesel::insert_into(directories::table) .values(&self.new_directories) - .execute(&*connection) // TODO https://github.com/diesel-rs/diesel/issues/1822 + .execute(&mut *connection) // TODO https://github.com/diesel-rs/diesel/issues/1822 .map_err(Error::new) }); if res.is_err() { @@ -100,10 +100,10 @@ impl Inserter { } fn flush_songs(&mut self) { - let res = self.db.connect().and_then(|connection| { + let res = self.db.connect().and_then(|mut connection| { diesel::insert_into(songs::table) .values(&self.new_songs) - .execute(&*connection) // TODO https://github.com/diesel-rs/diesel/issues/1822 + .execute(&mut *connection) // TODO https://github.com/diesel-rs/diesel/issues/1822 .map_err(Error::new) }); if res.is_err() { diff --git a/src/app/playlist/manager.rs b/src/app/playlist/manager.rs index ded563c..0828a86 100644 --- a/src/app/playlist/manager.rs +++ b/src/app/playlist/manager.rs @@ -22,14 +22,14 @@ impl Manager { } pub fn list_playlists(&self, owner: &str) -> Result, Error> { - let connection = self.db.connect()?; + let mut connection = self.db.connect()?; let user: User = { use self::users::dsl::*; users .filter(name.eq(owner)) .select((id,)) - .first(&connection) + .first(&mut connection) .optional() .map_err(anyhow::Error::new)? .ok_or(Error::UserNotFound)? @@ -39,7 +39,7 @@ impl Manager { use self::playlists::dsl::*; let found_playlists: Vec = Playlist::belonging_to(&user) .select(name) - .load(&connection) + .load(&mut connection) .map_err(anyhow::Error::new)?; Ok(found_playlists) } @@ -56,7 +56,7 @@ impl Manager { let vfs = self.vfs_manager.get_vfs()?; { - let connection = self.db.connect()?; + let mut connection = self.db.connect()?; // Find owner let user: User = { @@ -64,7 +64,7 @@ impl Manager { users .filter(name.eq(owner)) .select((id,)) - .first(&connection) + .first(&mut connection) .optional() .map_err(anyhow::Error::new)? .ok_or(Error::UserNotFound)? @@ -78,7 +78,7 @@ impl Manager { diesel::insert_into(playlists::table) .values(&new_playlist) - .execute(&connection) + .execute(&mut connection) .map_err(anyhow::Error::new)?; playlist = { @@ -86,7 +86,7 @@ impl Manager { playlists .select((id, owner)) .filter(name.eq(playlist_name).and(owner.eq(user.id))) - .get_result(&connection) + .get_result(&mut connection) .map_err(anyhow::Error::new)? } } @@ -110,17 +110,17 @@ impl Manager { } { - let connection = self.db.connect()?; + let mut connection = self.db.connect()?; connection - .transaction::<_, diesel::result::Error, _>(|| { + .transaction::<_, diesel::result::Error, _>(|connection| { // Delete old content (if any) let old_songs = PlaylistSong::belonging_to(&playlist); - diesel::delete(old_songs).execute(&connection)?; + diesel::delete(old_songs).execute(connection)?; // Insert content diesel::insert_into(playlist_songs::table) .values(&new_songs) - .execute(&*connection)?; // TODO https://github.com/diesel-rs/diesel/issues/1822 + .execute(&mut *connection)?; // TODO https://github.com/diesel-rs/diesel/issues/1822 Ok(()) }) .map_err(anyhow::Error::new)?; @@ -134,7 +134,7 @@ impl Manager { let songs: Vec; { - let connection = self.db.connect()?; + let mut connection = self.db.connect()?; // Find owner let user: User = { @@ -142,7 +142,7 @@ impl Manager { users .filter(name.eq(owner)) .select((id,)) - .first(&connection) + .first(&mut connection) .optional() .map_err(anyhow::Error::new)? .ok_or(Error::UserNotFound)? @@ -154,7 +154,7 @@ impl Manager { playlists .select((id, owner)) .filter(name.eq(playlist_name).and(owner.eq(user.id))) - .get_result(&connection) + .get_result(&mut connection) .optional() .map_err(anyhow::Error::new)? .ok_or(Error::PlaylistNotFound)? @@ -171,7 +171,9 @@ impl Manager { "#, ); let query = query.bind::(playlist.id); - songs = query.get_results(&connection).map_err(anyhow::Error::new)?; + songs = query + .get_results(&mut connection) + .map_err(anyhow::Error::new)?; } // Map real path to virtual paths @@ -184,14 +186,14 @@ impl Manager { } pub fn delete_playlist(&self, playlist_name: &str, owner: &str) -> Result<(), Error> { - let connection = self.db.connect()?; + let mut connection = self.db.connect()?; let user: User = { use self::users::dsl::*; users .filter(name.eq(owner)) .select((id,)) - .first(&connection) + .first(&mut connection) .optional() .map_err(anyhow::Error::new)? .ok_or(Error::UserNotFound)? @@ -201,7 +203,7 @@ impl Manager { use self::playlists::dsl::*; let q = Playlist::belonging_to(&user).filter(name.eq(playlist_name)); match diesel::delete(q) - .execute(&connection) + .execute(&mut connection) .map_err(anyhow::Error::new)? { 0 => Err(Error::PlaylistNotFound), @@ -212,28 +214,28 @@ impl Manager { } #[derive(Identifiable, Queryable, Associations)] -#[belongs_to(User, foreign_key = "owner")] +#[diesel(belongs_to(User, foreign_key = owner))] struct Playlist { id: i32, owner: i32, } #[derive(Identifiable, Queryable, Associations)] -#[belongs_to(Playlist, foreign_key = "playlist")] +#[diesel(belongs_to(Playlist, foreign_key = playlist))] struct PlaylistSong { id: i32, playlist: i32, } #[derive(Insertable)] -#[table_name = "playlists"] +#[diesel(table_name = playlists)] struct NewPlaylist { name: String, owner: i32, } #[derive(Insertable)] -#[table_name = "playlist_songs"] +#[diesel(table_name = playlist_songs)] struct NewPlaylistSong { playlist: i32, path: String, diff --git a/src/app/settings/manager.rs b/src/app/settings/manager.rs index f62db1c..0231db4 100644 --- a/src/app/settings/manager.rs +++ b/src/app/settings/manager.rs @@ -18,10 +18,10 @@ impl Manager { pub fn get_auth_secret(&self) -> Result { use self::misc_settings::dsl::*; - let connection = self.db.connect()?; + let mut connection = self.db.connect()?; let secret: Vec = misc_settings .select(auth_secret) - .get_result(&connection) + .get_result(&mut connection) .map_err(|e| match e { diesel::result::Error::NotFound => Error::AuthSecretNotFound, _ => Error::Unspecified, @@ -34,10 +34,10 @@ impl Manager { pub fn get_index_sleep_duration(&self) -> Result { use self::misc_settings::dsl::*; - let connection = self.db.connect()?; + let mut connection = self.db.connect()?; misc_settings .select(index_sleep_duration_seconds) - .get_result(&connection) + .get_result(&mut connection) .map_err(|e| match e { diesel::result::Error::NotFound => Error::IndexSleepDurationNotFound, _ => Error::Unspecified, @@ -47,10 +47,10 @@ impl Manager { pub fn get_index_album_art_pattern(&self) -> Result { use self::misc_settings::dsl::*; - let connection = self.db.connect()?; + let mut connection = self.db.connect()?; misc_settings .select(index_album_art_pattern) - .get_result(&connection) + .get_result(&mut connection) .map_err(|e| match e { diesel::result::Error::NotFound => Error::IndexAlbumArtPatternNotFound, _ => Error::Unspecified, @@ -61,10 +61,10 @@ impl Manager { } pub fn read(&self) -> Result { - let connection = self.db.connect()?; + let mut connection = self.db.connect()?; let misc: MiscSettings = misc_settings::table - .get_result(&connection) + .get_result(&mut connection) .map_err(|_| Error::Unspecified)?; Ok(Settings { @@ -75,19 +75,19 @@ impl Manager { } pub fn amend(&self, new_settings: &NewSettings) -> Result<(), Error> { - let connection = self.db.connect()?; + let mut connection = self.db.connect()?; if let Some(sleep_duration) = new_settings.reindex_every_n_seconds { diesel::update(misc_settings::table) .set(misc_settings::index_sleep_duration_seconds.eq(sleep_duration as i32)) - .execute(&connection) + .execute(&mut connection) .map_err(|_| Error::Unspecified)?; } if let Some(ref album_art_pattern) = new_settings.album_art_pattern { diesel::update(misc_settings::table) .set(misc_settings::index_album_art_pattern.eq(album_art_pattern)) - .execute(&connection) + .execute(&mut connection) .map_err(|_| Error::Unspecified)?; } diff --git a/src/app/user/manager.rs b/src/app/user/manager.rs index 236c9d2..47ce6b5 100644 --- a/src/app/user/manager.rs +++ b/src/app/user/manager.rs @@ -27,7 +27,7 @@ impl Manager { } let password_hash = hash_password(&new_user.password)?; - let connection = self.db.connect()?; + let mut connection = self.db.connect()?; let new_user = User { name: new_user.name.to_owned(), password_hash, @@ -36,48 +36,48 @@ impl Manager { diesel::insert_into(users::table) .values(&new_user) - .execute(&connection) + .execute(&mut connection) .map_err(|_| Error::Unspecified)?; Ok(()) } pub fn delete(&self, username: &str) -> Result<(), Error> { use crate::db::users::dsl::*; - let connection = self.db.connect()?; + let mut connection = self.db.connect()?; diesel::delete(users.filter(name.eq(username))) - .execute(&connection) + .execute(&mut connection) .map_err(|_| Error::Unspecified)?; Ok(()) } pub fn set_password(&self, username: &str, password: &str) -> Result<(), Error> { let hash = hash_password(password)?; - let connection = self.db.connect()?; + let mut connection = self.db.connect()?; use crate::db::users::dsl::*; diesel::update(users.filter(name.eq(username))) .set(password_hash.eq(hash)) - .execute(&connection) + .execute(&mut connection) .map_err(|_| Error::Unspecified)?; Ok(()) } pub fn set_is_admin(&self, username: &str, is_admin: bool) -> Result<(), Error> { use crate::db::users::dsl::*; - let connection = self.db.connect()?; + let mut connection = self.db.connect()?; diesel::update(users.filter(name.eq(username))) .set(admin.eq(is_admin as i32)) - .execute(&connection) + .execute(&mut connection) .map_err(|_| Error::Unspecified)?; Ok(()) } pub fn login(&self, username: &str, password: &str) -> Result { use crate::db::users::dsl::*; - let connection = self.db.connect()?; + let mut connection = self.db.connect()?; match users .select(password_hash) .filter(name.eq(username)) - .get_result(&connection) + .get_result(&mut connection) { Err(diesel::result::Error::NotFound) => Err(Error::IncorrectUsername), Ok(hash) => { @@ -146,38 +146,38 @@ impl Manager { pub fn count(&self) -> anyhow::Result { use crate::db::users::dsl::*; - let connection = self.db.connect()?; - let count = users.count().get_result(&connection)?; + let mut connection = self.db.connect()?; + let count = users.count().get_result(&mut connection)?; Ok(count) } pub fn list(&self) -> Result, Error> { use crate::db::users::dsl::*; - let connection = self.db.connect()?; + let mut connection = self.db.connect()?; users .select((name, password_hash, admin)) - .get_results(&connection) + .get_results(&mut connection) .map_err(|_| Error::Unspecified) } pub fn exists(&self, username: &str) -> Result { use crate::db::users::dsl::*; - let connection = self.db.connect()?; + let mut connection = self.db.connect()?; let results: Vec = users .select(name) .filter(name.eq(username)) - .get_results(&connection) + .get_results(&mut connection) .map_err(|_| Error::Unspecified)?; Ok(!results.is_empty()) } pub fn is_admin(&self, username: &str) -> Result { use crate::db::users::dsl::*; - let connection = self.db.connect()?; + let mut connection = self.db.connect()?; let is_admin: i32 = users .filter(name.eq(username)) .select(admin) - .get_result(&connection) + .get_result(&mut connection) .map_err(|_| Error::Unspecified)?; Ok(is_admin != 0) } @@ -189,13 +189,13 @@ impl Manager { session_key: &str, ) -> Result<(), Error> { use crate::db::users::dsl::*; - let connection = self.db.connect()?; + let mut connection = self.db.connect()?; diesel::update(users.filter(name.eq(username))) .set(( lastfm_username.eq(lastfm_login), lastfm_session_key.eq(session_key), )) - .execute(&connection) + .execute(&mut connection) .map_err(|_| Error::Unspecified)?; Ok(()) } @@ -209,11 +209,11 @@ impl Manager { pub fn get_lastfm_session_key(&self, username: &str) -> anyhow::Result { use crate::db::users::dsl::*; - let connection = self.db.connect()?; + let mut connection = self.db.connect()?; let token = users .filter(name.eq(username)) .select(lastfm_session_key) - .get_result(&connection)?; + .get_result(&mut connection)?; match token { Some(t) => Ok(t), _ => Err(anyhow!("Missing LastFM credentials")), @@ -226,11 +226,11 @@ impl Manager { pub fn lastfm_unlink(&self, username: &str) -> anyhow::Result<()> { use crate::db::users::dsl::*; - let connection = self.db.connect()?; + let mut connection = self.db.connect()?; let null: Option = None; diesel::update(users.filter(name.eq(username))) .set((lastfm_session_key.eq(&null), lastfm_username.eq(&null))) - .execute(&connection)?; + .execute(&mut connection)?; Ok(()) } } diff --git a/src/app/user/mod.rs b/src/app/user/mod.rs index cf60b1f..4630208 100644 --- a/src/app/user/mod.rs +++ b/src/app/user/mod.rs @@ -13,7 +13,7 @@ pub use manager::*; pub use preferences::*; #[derive(Debug, Insertable, Queryable)] -#[table_name = "users"] +#[diesel(table_name = users)] pub struct User { pub name: String, pub password_hash: String, diff --git a/src/app/user/preferences.rs b/src/app/user/preferences.rs index e8604c5..a0bb558 100644 --- a/src/app/user/preferences.rs +++ b/src/app/user/preferences.rs @@ -14,11 +14,11 @@ pub struct Preferences { impl Manager { pub fn read_preferences(&self, username: &str) -> Result { use self::users::dsl::*; - let connection = self.db.connect()?; + let mut connection = self.db.connect()?; let (theme_base, theme_accent, read_lastfm_username) = users .select((web_theme_base, web_theme_accent, lastfm_username)) .filter(name.eq(username)) - .get_result(&connection)?; + .get_result(&mut connection)?; Ok(Preferences { web_theme_base: theme_base, web_theme_accent: theme_accent, @@ -28,13 +28,13 @@ impl Manager { pub fn write_preferences(&self, username: &str, preferences: &Preferences) -> Result<()> { use crate::db::users::dsl::*; - let connection = self.db.connect()?; + let mut connection = self.db.connect()?; diesel::update(users.filter(name.eq(username))) .set(( web_theme_base.eq(&preferences.web_theme_base), web_theme_accent.eq(&preferences.web_theme_accent), )) - .execute(&connection)?; + .execute(&mut connection)?; Ok(()) } } diff --git a/src/app/vfs/manager.rs b/src/app/vfs/manager.rs index f4a5ea3..4a93704 100644 --- a/src/app/vfs/manager.rs +++ b/src/app/vfs/manager.rs @@ -23,20 +23,20 @@ impl Manager { pub fn mount_dirs(&self) -> Result> { use self::mount_points::dsl::*; - let connection = self.db.connect()?; + let mut connection = self.db.connect()?; let mount_dirs: Vec = mount_points .select((source, name)) - .get_results(&connection)?; + .get_results(&mut connection)?; Ok(mount_dirs) } pub fn set_mount_dirs(&self, mount_dirs: &[MountDir]) -> Result<()> { use self::mount_points::dsl::*; - let connection = self.db.connect()?; - diesel::delete(mount_points).execute(&connection)?; + let mut connection = self.db.connect()?; + diesel::delete(mount_points).execute(&mut connection)?; diesel::insert_into(mount_points) .values(mount_dirs) - .execute(&*connection)?; // TODO https://github.com/diesel-rs/diesel/issues/1822 + .execute(&mut *connection)?; // TODO https://github.com/diesel-rs/diesel/issues/1822 Ok(()) } } diff --git a/src/app/vfs/mod.rs b/src/app/vfs/mod.rs index 088700b..c7c0d92 100644 --- a/src/app/vfs/mod.rs +++ b/src/app/vfs/mod.rs @@ -13,7 +13,7 @@ mod test; pub use manager::*; #[derive(Clone, Debug, Deserialize, Insertable, PartialEq, Eq, Queryable, Serialize)] -#[table_name = "mount_points"] +#[diesel(table_name = mount_points)] pub struct MountDir { pub source: String, pub name: String, diff --git a/src/db/mod.rs b/src/db/mod.rs index f75db74..477c86e 100644 --- a/src/db/mod.rs +++ b/src/db/mod.rs @@ -2,15 +2,15 @@ use anyhow::{bail, Error, Result}; use diesel::r2d2::{self, ConnectionManager, PooledConnection}; use diesel::sqlite::SqliteConnection; use diesel::RunQueryDsl; +use diesel_migrations::EmbeddedMigrations; +use diesel_migrations::MigrationHarness; use std::path::Path; mod schema; pub use self::schema::*; -#[allow(dead_code)] -const DB_MIGRATIONS_PATH: &str = "migrations"; -embed_migrations!("migrations"); +const MIGRATIONS: EmbeddedMigrations = embed_migrations!("migrations"); #[derive(Clone)] pub struct DB { @@ -56,25 +56,16 @@ impl DB { #[allow(dead_code)] fn migrate_down(&self) -> Result<()> { - let connection = self.connect().unwrap(); - loop { - match diesel_migrations::revert_latest_migration_in_directory( - &connection, - Path::new(DB_MIGRATIONS_PATH), - ) { - Ok(_) => (), - Err(diesel_migrations::RunMigrationsError::MigrationError( - diesel_migrations::MigrationError::NoMigrationRun, - )) => break, - Err(e) => bail!(e), - } + let mut connection = self.connect().unwrap(); + if let Err(e) = connection.revert_all_migrations(MIGRATIONS) { + bail!(e); } Ok(()) } fn migrate_up(&self) -> Result<()> { - let connection = self.connect().unwrap(); - embedded_migrations::run(&connection)?; + let mut connection = self.connect().unwrap(); + connection.run_pending_migrations(MIGRATIONS).unwrap(); Ok(()) } }