diff --git a/Cargo.lock b/Cargo.lock index a001630..19afc19 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -109,7 +109,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" [[package]] name = "bytecount" -version = "0.5.1" +version = "0.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" [[package]] @@ -336,7 +336,7 @@ dependencies = [ [[package]] name = "env_logger" -version = "0.6.2" +version = "0.7.1" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "log 0.4.8 (registry+https://github.com/rust-lang/crates.io-index)", @@ -660,19 +660,6 @@ dependencies = [ "libc 0.2.66 (registry+https://github.com/rust-lang/crates.io-index)", ] -[[package]] -name = "html5ever" -version = "0.22.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -dependencies = [ - "log 0.4.8 (registry+https://github.com/rust-lang/crates.io-index)", - "mac 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", - "markup5ever 0.7.5 (registry+https://github.com/rust-lang/crates.io-index)", - "proc-macro2 0.4.30 (registry+https://github.com/rust-lang/crates.io-index)", - "quote 0.6.13 (registry+https://github.com/rust-lang/crates.io-index)", - "syn 0.15.44 (registry+https://github.com/rust-lang/crates.io-index)", -] - [[package]] name = "html5ever" version = "0.24.1" @@ -874,21 +861,6 @@ name = "maplit" version = "1.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" -[[package]] -name = "markup5ever" -version = "0.7.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -dependencies = [ - "phf 0.7.24 (registry+https://github.com/rust-lang/crates.io-index)", - "phf_codegen 0.7.24 (registry+https://github.com/rust-lang/crates.io-index)", - "serde 1.0.103 (registry+https://github.com/rust-lang/crates.io-index)", - "serde_derive 1.0.103 (registry+https://github.com/rust-lang/crates.io-index)", - "serde_json 1.0.44 (registry+https://github.com/rust-lang/crates.io-index)", - "string_cache 0.7.5 (registry+https://github.com/rust-lang/crates.io-index)", - "string_cache_codegen 0.4.4 (registry+https://github.com/rust-lang/crates.io-index)", - "tendril 0.4.1 (registry+https://github.com/rust-lang/crates.io-index)", -] - [[package]] name = "markup5ever" version = "0.9.0" @@ -917,7 +889,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" [[package]] name = "md5" -version = "0.6.1" +version = "0.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" [[package]] @@ -1123,6 +1095,11 @@ dependencies = [ "libc 0.2.66 (registry+https://github.com/rust-lang/crates.io-index)", ] +[[package]] +name = "once_cell" +version = "1.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" + [[package]] name = "opaque-debug" version = "0.2.3" @@ -1209,22 +1186,22 @@ name = "pastebinrun" version = "0.1.0" dependencies = [ "ammonia 3.0.0 (registry+https://github.com/rust-lang/crates.io-index)", - "base64 0.10.1 (registry+https://github.com/rust-lang/crates.io-index)", + "base64 0.11.0 (registry+https://github.com/rust-lang/crates.io-index)", "chrono 0.4.10 (registry+https://github.com/rust-lang/crates.io-index)", "diesel 1.4.3 (registry+https://github.com/rust-lang/crates.io-index)", "diesel_migrations 1.4.0 (registry+https://github.com/rust-lang/crates.io-index)", - "env_logger 0.6.2 (registry+https://github.com/rust-lang/crates.io-index)", + "env_logger 0.7.1 (registry+https://github.com/rust-lang/crates.io-index)", "extension-trait 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)", "futures 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)", "itertools 0.8.2 (registry+https://github.com/rust-lang/crates.io-index)", - "lazy_static 1.4.0 (registry+https://github.com/rust-lang/crates.io-index)", "log 0.4.8 (registry+https://github.com/rust-lang/crates.io-index)", "mime 0.3.14 (registry+https://github.com/rust-lang/crates.io-index)", - "pulldown-cmark 0.5.3 (registry+https://github.com/rust-lang/crates.io-index)", + "once_cell 1.2.0 (registry+https://github.com/rust-lang/crates.io-index)", + "pulldown-cmark 0.6.1 (registry+https://github.com/rust-lang/crates.io-index)", "rand 0.7.2 (registry+https://github.com/rust-lang/crates.io-index)", "reqwest 0.10.0-alpha.2 (registry+https://github.com/rust-lang/crates.io-index)", - "ructe 0.6.4 (registry+https://github.com/rust-lang/crates.io-index)", - "scraper 0.10.1 (registry+https://github.com/rust-lang/crates.io-index)", + "ructe 0.8.0 (registry+https://github.com/rust-lang/crates.io-index)", + "scraper 0.11.0 (registry+https://github.com/rust-lang/crates.io-index)", "serde 1.0.103 (registry+https://github.com/rust-lang/crates.io-index)", "serde_json 1.0.44 (registry+https://github.com/rust-lang/crates.io-index)", "time-parse 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)", @@ -1334,14 +1311,6 @@ name = "proc-macro-nested" version = "0.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" -[[package]] -name = "proc-macro2" -version = "0.4.30" -source = "registry+https://github.com/rust-lang/crates.io-index" -dependencies = [ - "unicode-xid 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)", -] - [[package]] name = "proc-macro2" version = "1.0.6" @@ -1357,7 +1326,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" [[package]] name = "pulldown-cmark" -version = "0.5.3" +version = "0.6.1" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "bitflags 1.2.1 (registry+https://github.com/rust-lang/crates.io-index)", @@ -1371,14 +1340,6 @@ name = "quick-error" version = "1.2.2" source = "registry+https://github.com/rust-lang/crates.io-index" -[[package]] -name = "quote" -version = "0.6.13" -source = "registry+https://github.com/rust-lang/crates.io-index" -dependencies = [ - "proc-macro2 0.4.30 (registry+https://github.com/rust-lang/crates.io-index)", -] - [[package]] name = "quote" version = "1.0.2" @@ -1588,15 +1549,14 @@ dependencies = [ [[package]] name = "ructe" -version = "0.6.4" +version = "0.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "base64 0.10.1 (registry+https://github.com/rust-lang/crates.io-index)", - "bytecount 0.5.1 (registry+https://github.com/rust-lang/crates.io-index)", + "base64 0.11.0 (registry+https://github.com/rust-lang/crates.io-index)", + "bytecount 0.6.0 (registry+https://github.com/rust-lang/crates.io-index)", "itertools 0.8.2 (registry+https://github.com/rust-lang/crates.io-index)", - "lazy_static 1.4.0 (registry+https://github.com/rust-lang/crates.io-index)", - "md5 0.6.1 (registry+https://github.com/rust-lang/crates.io-index)", - "nom 4.2.3 (registry+https://github.com/rust-lang/crates.io-index)", + "md5 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)", + "nom 5.0.1 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -1651,13 +1611,13 @@ source = "registry+https://github.com/rust-lang/crates.io-index" [[package]] name = "scraper" -version = "0.10.1" +version = "0.11.0" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "cssparser 0.25.9 (registry+https://github.com/rust-lang/crates.io-index)", "ego-tree 0.6.2 (registry+https://github.com/rust-lang/crates.io-index)", "getopts 0.2.21 (registry+https://github.com/rust-lang/crates.io-index)", - "html5ever 0.22.5 (registry+https://github.com/rust-lang/crates.io-index)", + "html5ever 0.24.1 (registry+https://github.com/rust-lang/crates.io-index)", "matches 0.1.8 (registry+https://github.com/rust-lang/crates.io-index)", "selectors 0.21.0 (registry+https://github.com/rust-lang/crates.io-index)", "smallvec 0.6.13 (registry+https://github.com/rust-lang/crates.io-index)", @@ -1855,16 +1815,6 @@ name = "string_cache_shared" version = "0.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -[[package]] -name = "syn" -version = "0.15.44" -source = "registry+https://github.com/rust-lang/crates.io-index" -dependencies = [ - "proc-macro2 0.4.30 (registry+https://github.com/rust-lang/crates.io-index)", - "quote 0.6.13 (registry+https://github.com/rust-lang/crates.io-index)", - "unicode-xid 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)", -] - [[package]] name = "syn" version = "1.0.11" @@ -2198,11 +2148,6 @@ name = "unicode-width" version = "0.1.7" source = "registry+https://github.com/rust-lang/crates.io-index" -[[package]] -name = "unicode-xid" -version = "0.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" - [[package]] name = "unicode-xid" version = "0.2.0" @@ -2441,7 +2386,7 @@ dependencies = [ "checksum buf_redux 0.8.4 (registry+https://github.com/rust-lang/crates.io-index)" = "b953a6887648bb07a535631f2bc00fbdb2a2216f135552cb3f534ed136b9c07f" "checksum bumpalo 2.6.0 (registry+https://github.com/rust-lang/crates.io-index)" = "ad807f2fc2bf185eeb98ff3a901bd46dc5ad58163d0fa4577ba0d25674d71708" "checksum byte-tools 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)" = "e3b5ca7a04898ad4bcd41c90c5285445ff5b791899bb1b0abdd2a2aa791211d7" -"checksum bytecount 0.5.1 (registry+https://github.com/rust-lang/crates.io-index)" = "be0fdd54b507df8f22012890aadd099979befdba27713c767993f8380112ca7c" +"checksum bytecount 0.6.0 (registry+https://github.com/rust-lang/crates.io-index)" = "b0017894339f586ccb943b01b9555de56770c11cda818e7e3d8bd93f4ed7f46e" "checksum byteorder 1.3.2 (registry+https://github.com/rust-lang/crates.io-index)" = "a7c3dd8985a7111efc5c80b44e23ecdd8c007de8ade3b96595387e812b957cf5" "checksum bytes 0.4.12 (registry+https://github.com/rust-lang/crates.io-index)" = "206fdffcfa2df7cbe15601ef46c813fce0965eb3286db6b56c583b814b51c81c" "checksum c2-chacha 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)" = "214238caa1bf3a496ec3392968969cab8549f96ff30652c9e56885329315f6bb" @@ -2468,7 +2413,7 @@ dependencies = [ "checksum ego-tree 0.6.2 (registry+https://github.com/rust-lang/crates.io-index)" = "3a68a4904193147e0a8dec3314640e6db742afd5f6e634f428a6af230d9b3591" "checksum either 1.5.3 (registry+https://github.com/rust-lang/crates.io-index)" = "bb1f6b1ce1c140482ea30ddd3335fc0024ac7ee112895426e0a629a6c20adfe3" "checksum encoding_rs 0.8.20 (registry+https://github.com/rust-lang/crates.io-index)" = "87240518927716f79692c2ed85bfe6e98196d18c6401ec75355760233a7e12e9" -"checksum env_logger 0.6.2 (registry+https://github.com/rust-lang/crates.io-index)" = "aafcde04e90a5226a6443b7aabdb016ba2f8307c847d524724bd9b346dd1a2d3" +"checksum env_logger 0.7.1 (registry+https://github.com/rust-lang/crates.io-index)" = "44533bbbb3bb3c1fa17d9f2e4e38bbbaf8396ba82193c4cb1b6445d711445d36" "checksum extension-trait 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)" = "d3e9c5c7ccae01c71be04493526eaf660c662c47e4a34880ae0c7c84551cd85d" "checksum failure 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)" = "f8273f13c977665c5db7eb2b99ae520952fe5ac831ae4cd09d80c4c7042b5ed9" "checksum failure_derive 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)" = "0bc225b78e0391e4b8683440bf2e63c2deeeb2ce5189eab46e2b68c6d3725d08" @@ -2505,7 +2450,6 @@ dependencies = [ "checksum headers-core 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "967131279aaa9f7c20c7205b45a391638a83ab118e6509b2d0ccbe08de044237" "checksum heck 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)" = "20564e78d53d2bb135c343b3f47714a56af2061f1c928fdb541dc7b9fdd94205" "checksum hermit-abi 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)" = "307c3c9f937f38e3534b1d6447ecf090cafcc9744e4a6360e8b037b2cf5af120" -"checksum html5ever 0.22.5 (registry+https://github.com/rust-lang/crates.io-index)" = "c213fa6a618dc1da552f54f85cba74b05d8e883c92ec4e89067736938084c26e" "checksum html5ever 0.24.1 (registry+https://github.com/rust-lang/crates.io-index)" = "025483b0a1e4577bb28578318c886ee5f817dda6eb62473269349044406644cb" "checksum http 0.1.21 (registry+https://github.com/rust-lang/crates.io-index)" = "d6ccf5ede3a895d8856620237b2f02972c1bbc78d2965ad7fe8838d4a0ed41f0" "checksum http-body 0.2.0-alpha.3 (registry+https://github.com/rust-lang/crates.io-index)" = "1f3aef6f3de2bd8585f5b366f3f550b5774500b4764d00cf00f903c95749eec3" @@ -2528,11 +2472,10 @@ dependencies = [ "checksum log 0.4.8 (registry+https://github.com/rust-lang/crates.io-index)" = "14b6052be84e6b71ab17edffc2eeabf5c2c3ae1fdb464aae35ac50c67a44e1f7" "checksum mac 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "c41e0c4fef86961ac6d6f8a82609f55f31b05e4fce149ac5710e439df7619ba4" "checksum maplit 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)" = "3e2e65a1a2e43cfcb47a895c4c8b10d1f4a61097f9f254f183aee60cad9c651d" -"checksum markup5ever 0.7.5 (registry+https://github.com/rust-lang/crates.io-index)" = "897636f9850c3eef4905a5540683ed53dc9393860f0846cab2c2ddf9939862ff" "checksum markup5ever 0.9.0 (registry+https://github.com/rust-lang/crates.io-index)" = "65381d9d47506b8592b97c4efd936afcf673b09b059f2bef39c7211ee78b9d03" "checksum matches 0.1.8 (registry+https://github.com/rust-lang/crates.io-index)" = "7ffc5c5338469d4d3ea17d269fa8ea3512ad247247c30bd2df69e68309ed0a08" "checksum maybe-uninit 2.0.0 (registry+https://github.com/rust-lang/crates.io-index)" = "60302e4db3a61da70c0cb7991976248362f30319e88850c487b9b95bbf059e00" -"checksum md5 0.6.1 (registry+https://github.com/rust-lang/crates.io-index)" = "7e6bcd6433cff03a4bfc3d9834d504467db1f1cf6d0ea765d37d330249ed629d" +"checksum md5 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)" = "490cc448043f947bae3cbee9c203358d62dbee0db12107a74be5c30ccfd09771" "checksum memchr 2.2.1 (registry+https://github.com/rust-lang/crates.io-index)" = "88579771288728879b57485cc7d6b07d648c9f0141eb955f8ab7f9d45394468e" "checksum memoffset 0.5.3 (registry+https://github.com/rust-lang/crates.io-index)" = "75189eb85871ea5c2e2c15abbdd541185f63b408415e5051f5cac122d8c774b9" "checksum migrations_internals 1.4.0 (registry+https://github.com/rust-lang/crates.io-index)" = "8089920229070f914b9ce9b07ef60e175b2b9bc2d35c3edd8bf4433604e863b9" @@ -2554,6 +2497,7 @@ dependencies = [ "checksum num-integer 0.1.41 (registry+https://github.com/rust-lang/crates.io-index)" = "b85e541ef8255f6cf42bbfe4ef361305c6c135d10919ecc26126c4e5ae94bc09" "checksum num-traits 0.2.10 (registry+https://github.com/rust-lang/crates.io-index)" = "d4c81ffc11c212fa327657cb19dd85eb7419e163b5b076bede2bdb5c974c07e4" "checksum num_cpus 1.11.1 (registry+https://github.com/rust-lang/crates.io-index)" = "76dac5ed2a876980778b8b85f75a71b6cbf0db0b1232ee12f826bccb00d09d72" +"checksum once_cell 1.2.0 (registry+https://github.com/rust-lang/crates.io-index)" = "891f486f630e5c5a4916c7e16c4b24a53e78c860b646e9f8e005e4f16847bfed" "checksum opaque-debug 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)" = "2839e79665f131bdb5782e51f2c6c9599c133c6098982a54c794358bf432529c" "checksum openssl 0.10.26 (registry+https://github.com/rust-lang/crates.io-index)" = "3a3cc5799d98e1088141b8e01ff760112bbd9f19d850c124500566ca6901a585" "checksum openssl-probe 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)" = "77af24da69f9d9341038eba93a073b1fdaaa1b788221b00a69bce9e762cb32de" @@ -2576,12 +2520,10 @@ dependencies = [ "checksum precomputed-hash 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "925383efa346730478fb4838dbe9137d2a47675ad789c546d150a6e1dd4ab31c" "checksum proc-macro-hack 0.5.11 (registry+https://github.com/rust-lang/crates.io-index)" = "ecd45702f76d6d3c75a80564378ae228a85f0b59d2f3ed43c91b4a69eb2ebfc5" "checksum proc-macro-nested 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)" = "369a6ed065f249a159e06c45752c780bda2fb53c995718f9e484d08daa9eb42e" -"checksum proc-macro2 0.4.30 (registry+https://github.com/rust-lang/crates.io-index)" = "cf3d2011ab5c909338f7887f4fc896d35932e29146c12c8d01da6b22a80ba759" "checksum proc-macro2 1.0.6 (registry+https://github.com/rust-lang/crates.io-index)" = "9c9e470a8dc4aeae2dee2f335e8f533e2d4b347e1434e5671afc49b054592f27" "checksum procedural-masquerade 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)" = "9a1574a51c3fd37b26d2c0032b649d08a7d51d4cca9c41bbc5bf7118fa4509d0" -"checksum pulldown-cmark 0.5.3 (registry+https://github.com/rust-lang/crates.io-index)" = "77043da1282374688ee212dc44b3f37ff929431de9c9adc3053bd3cee5630357" +"checksum pulldown-cmark 0.6.1 (registry+https://github.com/rust-lang/crates.io-index)" = "1c205cc82214f3594e2d50686730314f817c67ffa80fe800cf0db78c3c2b9d9e" "checksum quick-error 1.2.2 (registry+https://github.com/rust-lang/crates.io-index)" = "9274b940887ce9addde99c4eee6b5c44cc494b182b97e73dc8ffdcb3397fd3f0" -"checksum quote 0.6.13 (registry+https://github.com/rust-lang/crates.io-index)" = "6ce23b6b870e8f94f81fb0a363d65d86675884b34a09043c81e5562f11c1f8e1" "checksum quote 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)" = "053a8c8bcc71fcce321828dc897a98ab9760bef03a4fc36693c231e5b3216cfe" "checksum r2d2 0.8.7 (registry+https://github.com/rust-lang/crates.io-index)" = "22b5c5fc5fba064373f03887337b412e0e1562d63023393db77251146cb75553" "checksum rand 0.6.5 (registry+https://github.com/rust-lang/crates.io-index)" = "6d71dacdc3c88c1fde3885a3be3fbab9f35724e6ce99467f7d9c5026132184ca" @@ -2602,7 +2544,7 @@ dependencies = [ "checksum redox_syscall 0.1.56 (registry+https://github.com/rust-lang/crates.io-index)" = "2439c63f3f6139d1b57529d16bc3b8bb855230c8efcc5d3a896c8bea7c3b1e84" "checksum remove_dir_all 0.5.2 (registry+https://github.com/rust-lang/crates.io-index)" = "4a83fa3702a688b9359eccba92d153ac33fd2e8462f9e0e3fdf155239ea7792e" "checksum reqwest 0.10.0-alpha.2 (registry+https://github.com/rust-lang/crates.io-index)" = "e83b47defcad97ddbe592fd5fe49e16661f754b0ba5847cf41bcd870a2d338d7" -"checksum ructe 0.6.4 (registry+https://github.com/rust-lang/crates.io-index)" = "f061e6ed7558decb33975c99189116a71c78620047763fbe50429f87d3e69694" +"checksum ructe 0.8.0 (registry+https://github.com/rust-lang/crates.io-index)" = "7efa487b87ce205d63047b7019d259ad27cceb4ca764afb6d13f6edfc803ada8" "checksum rustc-demangle 0.1.16 (registry+https://github.com/rust-lang/crates.io-index)" = "4c691c0e608126e00913e33f0ccf3727d5fc84573623b8d65b2df340b5201783" "checksum rustc_version 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)" = "138e3e0acb6c9fb258b19b67cb8abd63c00679d2851805ea151465464fe9030a" "checksum ryu 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)" = "bfa8506c1de11c9c4e4c38863ccbe02a305c8188e85a05a784c9e11e1c3910c8" @@ -2611,7 +2553,7 @@ dependencies = [ "checksum scheduled-thread-pool 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)" = "f5de7bc31f28f8e6c28df5e1bf3d10610f5fdc14cc95f272853512c70a2bd779" "checksum scoped-tls 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)" = "ea6a9290e3c9cf0f18145ef7ffa62d68ee0bf5fcd651017e586dc7fd5da448c2" "checksum scopeguard 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)" = "b42e15e59b18a828bbf5c58ea01debb36b9b096346de35d941dcb89009f24a0d" -"checksum scraper 0.10.1 (registry+https://github.com/rust-lang/crates.io-index)" = "51be82984aed4ce8639d23eaf42b001e7cc630e6125a54ecab77bf7a3e9ee711" +"checksum scraper 0.11.0 (registry+https://github.com/rust-lang/crates.io-index)" = "77e013440e2ab1c25065551adda5a9773698bb5be3dbab06ff2deac3d5c1a793" "checksum security-framework 0.3.4 (registry+https://github.com/rust-lang/crates.io-index)" = "8ef2429d7cefe5fd28bd1d2ed41c944547d4ff84776f5935b456da44593a16df" "checksum security-framework-sys 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)" = "e31493fc37615debb8c5090a7aeb4a9730bc61e77ab10b9af59f1a202284f895" "checksum selectors 0.21.0 (registry+https://github.com/rust-lang/crates.io-index)" = "1b86b100bede4f651059740afc3b6cb83458d7401cb7c1ad96d8a11e91742c86" @@ -2635,7 +2577,6 @@ dependencies = [ "checksum string_cache 0.7.5 (registry+https://github.com/rust-lang/crates.io-index)" = "89c058a82f9fd69b1becf8c274f412281038877c553182f1d02eb027045a2d67" "checksum string_cache_codegen 0.4.4 (registry+https://github.com/rust-lang/crates.io-index)" = "f0f45ed1b65bf9a4bf2f7b7dc59212d1926e9eaf00fa998988e420fd124467c6" "checksum string_cache_shared 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)" = "b1884d1bc09741d466d9b14e6d37ac89d6909cbcac41dd9ae982d4d063bbedfc" -"checksum syn 0.15.44 (registry+https://github.com/rust-lang/crates.io-index)" = "9ca4b3b69a77cbe1ffc9e198781b7acb0c7365a883670e8f1c1bc66fba79a5c5" "checksum syn 1.0.11 (registry+https://github.com/rust-lang/crates.io-index)" = "dff0acdb207ae2fe6d5976617f887eb1e35a2ba52c13c7234c790960cdad9238" "checksum synstructure 0.12.3 (registry+https://github.com/rust-lang/crates.io-index)" = "67656ea1dc1b41b1451851562ea232ec2e5a80242139f7e679ceccfb5d61f545" "checksum tempfile 3.1.0 (registry+https://github.com/rust-lang/crates.io-index)" = "7a6e24d9338a0a5be79593e2fa15a648add6138caa803e2d5bc782c371732ca9" @@ -2668,7 +2609,6 @@ dependencies = [ "checksum unicode-normalization 0.1.11 (registry+https://github.com/rust-lang/crates.io-index)" = "b561e267b2326bb4cebfc0ef9e68355c7abe6c6f522aeac2f5bf95d56c59bdcf" "checksum unicode-segmentation 1.6.0 (registry+https://github.com/rust-lang/crates.io-index)" = "e83e153d1053cbb5a118eeff7fd5be06ed99153f00dbcd8ae310c5fb2b22edc0" "checksum unicode-width 0.1.7 (registry+https://github.com/rust-lang/crates.io-index)" = "caaa9d531767d1ff2150b9332433f32a24622147e5ebb1f26409d5da67afd479" -"checksum unicode-xid 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)" = "fc72304796d0818e357ead4e000d19c9c174ab23dc11093ac919054d20a6a7fc" "checksum unicode-xid 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)" = "826e7639553986605ec5979c7dd957c7895e93eabed50ab2ffa7f6128a75097c" "checksum url 2.1.0 (registry+https://github.com/rust-lang/crates.io-index)" = "75b414f6c464c879d7f9babf951f23bc3743fb7313c081b2e6ca719067ea9d61" "checksum urlencoding 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)" = "3df3561629a8bb4c57e5a2e4c43348d9e29c7c29d9b1c4c1f47166deca8f37ed" diff --git a/Cargo.toml b/Cargo.toml index 2c54d83..ed94e55 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -8,32 +8,32 @@ build = "src/build.rs" [dependencies] ammonia = "3.0.0" -base64 = "0.10.1" -chrono = "0.4.9" -diesel = { version = "1.4.1", features = ["chrono", "postgres", "r2d2"] } +base64 = "0.11.0" +chrono = "0.4.10" +diesel = { version = "1.4.3", features = ["chrono", "postgres", "r2d2"] } diesel_migrations = "1.4.0" -env_logger = { version = "0.6.0", default-features = false } +env_logger = { version = "0.7.1", default-features = false } extension-trait = "0.2.1" -futures03 = { version = "0.3.1", package = "futures" } -itertools = "0.8.1" -lazy_static = "1.3.0" -log = "0.4.6" -mime = "0.3.13" -pulldown-cmark = "0.5.0" -rand = "0.7.0" +futures = "0.3.1" +itertools = "0.8.2" +log = "0.4.8" +mime = "0.3.14" +once_cell = "1.2.0" +pulldown-cmark = "0.6.1" +rand = "0.7.2" reqwest = { version = "=0.10.0-alpha.2", features = ["json"] } -serde = { version = "1.0.88", features = ["derive"] } -serde_json = "1.0.41" +serde = { version = "1.0.103", features = ["derive"] } +serde_json = "1.0.44" time-parse = "0.1.2" tokio = "=0.2.0-alpha.6" -tokio-executor = { version = "0.2.0-alpha.4", features = ["blocking"] } +tokio-executor = { version = "=0.2.0-alpha.6", features = ["blocking"] } warp = { git = "https://github.com/seanmonstar/warp.git", rev = "fb64f24b6126efc618ca04a29acf1a7d4737c33c" } [build-dependencies] -ructe = { version = "0.6.2" } +ructe = "0.8.0" [dev-dependencies] -scraper = "0.10.1" +scraper = "0.11.0" [features] database_tests = [] diff --git a/src/migration.rs b/src/migration.rs index 1287592..c03d5f0 100644 --- a/src/migration.rs +++ b/src/migration.rs @@ -1,4 +1,5 @@ use crate::models::paste; +use crate::models::paste::ExtraPasteParameters; use crate::schema::{implementation_wrappers, implementations, languages, pastes}; use crate::Connection; use diesel::prelude::*; @@ -71,10 +72,7 @@ pub fn run(connection: &Connection) -> Result<(), Box> { None, &languages_identifier, hello_world, - "".into(), - None, - None, - None, + ExtraPasteParameters::default(), ) .unwrap(); diesel::update(languages::table) diff --git a/src/models/paste.rs b/src/models/paste.rs index da296f5..d3dd512 100644 --- a/src/models/paste.rs +++ b/src/models/paste.rs @@ -6,8 +6,8 @@ use ammonia::Builder; use chrono::{DateTime, Utc}; use diesel::prelude::*; use itertools::Itertools; -use lazy_static::lazy_static; use log::info; +use once_cell::sync::Lazy; use pulldown_cmark::{Options, Parser}; use rand::seq::SliceRandom; use std::iter; @@ -53,15 +53,25 @@ struct InsertPaste { exit_code: Option, } +#[derive(Default)] +pub struct ExtraPasteParameters { + pub stdin: String, + pub stdout: Option, + pub stderr: Option, + pub exit_code: Option, +} + pub fn insert( connection: &Connection, delete_at: Option>, language: &str, paste: String, - stdin: String, - stdout: Option, - stderr: Option, - exit_code: Option, + ExtraPasteParameters { + stdin, + stdout, + stderr, + exit_code, + }: ExtraPasteParameters, ) -> Result { let mut rng = rand::thread_rng(); let identifier: String = (0..10) @@ -145,27 +155,25 @@ impl ExternPaste { } fn render_markdown(markdown: &str) -> String { - lazy_static! { - static ref FILTER: Builder<'static> = { - let mut builder = Builder::new(); - builder.link_rel(Some("noopener noreferrer nofollow")); - builder.add_generic_attributes(iter::once("class")); - builder.attribute_filter(|_, attribute, value| { - if attribute == "class" { - Some( - value - .split_ascii_whitespace() - .filter(|value| value.starts_with("language-")) - .join(" ") - .into(), - ) - } else { - Some(value.into()) - } - }); - builder - }; - } + static FILTER: Lazy> = Lazy::new(|| { + let mut builder = Builder::new(); + builder.link_rel(Some("noopener noreferrer nofollow")); + builder.add_generic_attributes(iter::once("class")); + builder.attribute_filter(|_, attribute, value| { + if attribute == "class" { + Some( + value + .split_ascii_whitespace() + .filter(|value| value.starts_with("language-")) + .join(" ") + .into(), + ) + } else { + Some(value.into()) + } + }); + builder + }); let mut output = String::new(); let options = Options::ENABLE_TABLES | Options::ENABLE_STRIKETHROUGH; pulldown_cmark::html::push_html(&mut output, Parser::new_ext(markdown, options)); diff --git a/src/routes/api_v1/pastes.rs b/src/routes/api_v1/pastes.rs index eaae68c..5b8d1b9 100644 --- a/src/routes/api_v1/pastes.rs +++ b/src/routes/api_v1/pastes.rs @@ -1,4 +1,4 @@ -use crate::models::paste; +use crate::models::paste::{self, ExtraPasteParameters}; use crate::Connection; use chrono::{Duration, Utc}; use serde::de::{Deserializer, Unexpected, Visitor}; @@ -67,10 +67,12 @@ pub async fn insert_paste( expiration.map(|expiration| Utc::now() + expiration.0), &language, code, - "".into(), - None, - None, - None, + ExtraPasteParameters { + stdin: "".into(), + stdout: None, + stderr: None, + exit_code: None, + }, ) }) .await diff --git a/src/routes/insert_paste.rs b/src/routes/insert_paste.rs index cf24095..c49167c 100644 --- a/src/routes/insert_paste.rs +++ b/src/routes/insert_paste.rs @@ -1,4 +1,5 @@ use crate::models::paste; +use crate::models::paste::ExtraPasteParameters; use crate::Connection; use chrono::{Duration, Utc}; use serde::de::IgnoredAny; @@ -39,10 +40,12 @@ pub async fn insert_paste( delete_at, &language, code, - stdin, - stdout, - stderr, - status, + ExtraPasteParameters { + stdin, + stdout, + stderr, + exit_code: status, + }, )?; Ok(reply::with_header( StatusCode::SEE_OTHER, diff --git a/src/routes/mod.rs b/src/routes/mod.rs index d5e200e..a970d4a 100644 --- a/src/routes/mod.rs +++ b/src/routes/mod.rs @@ -13,7 +13,7 @@ use crate::templates; use crate::Connection; use diesel::prelude::*; use diesel::r2d2::{ConnectionManager, Pool}; -use futures03::{Future, FutureExt}; +use futures::{Future, FutureExt}; use std::ffi::OsStr; use std::path::PathBuf; use std::pin::Pin; @@ -223,7 +223,7 @@ mod test { use crate::migration; use diesel::r2d2::{ConnectionManager, CustomizeConnection, Pool}; use diesel::Connection; - use lazy_static::lazy_static; + use once_cell::sync::Lazy; use scraper::{Html, Selector}; use serde::Deserialize; use std::env; @@ -234,20 +234,18 @@ mod test { use warp::reply::{Reply, Response}; use warp::Filter; - lazy_static! { - static ref ROUTES: BoxedFilter<(Response,)> = { - let pool = Pool::builder() - .connection_customizer(Box::new(ExecuteWithinTransaction)) - .max_size(1) - .build(ConnectionManager::new(env::var("DATABASE_URL").expect( - "Setting DATABASE_URL environment variable required to run tests", - ))) - .expect("Couldn't create a connection connection"); - diesel_migrations::run_pending_migrations(&pool.get().unwrap()).unwrap(); - migration::run(&pool.get().unwrap()).unwrap(); - routes(pool).map(Reply::into_response).boxed() - }; - } + static ROUTES: Lazy> = Lazy::new(|| { + let pool = Pool::builder() + .connection_customizer(Box::new(ExecuteWithinTransaction)) + .max_size(1) + .build(ConnectionManager::new(env::var("DATABASE_URL").expect( + "Setting DATABASE_URL environment variable required to run tests", + ))) + .expect("Couldn't create a connection connection"); + diesel_migrations::run_pending_migrations(&pool.get().unwrap()).unwrap(); + migration::run(&pool.get().unwrap()).unwrap(); + routes(pool).map(Reply::into_response).boxed() + }); #[derive(Debug)] struct ExecuteWithinTransaction; diff --git a/src/routes/run.rs b/src/routes/run.rs index e75a3c9..c6482a4 100644 --- a/src/routes/run.rs +++ b/src/routes/run.rs @@ -2,8 +2,8 @@ use crate::models::db::DbErrorExt; use crate::schema::implementation_wrappers; use crate::Connection; use diesel::prelude::*; -use futures03::TryFutureExt; -use lazy_static::lazy_static; +use futures::TryFutureExt; +use once_cell::sync::Lazy; use reqwest::r#async::Client; use serde::{Deserialize, Serialize}; use std::env; @@ -11,10 +11,8 @@ use tokio_executor::blocking; use warp::reject::Reject; use warp::{Rejection, Reply}; -lazy_static! { - static ref CLIENT: Client = Client::new(); - static ref SANDBOX_URL: String = env::var("SANDBOX_URL").unwrap(); -} +static CLIENT: Lazy = Lazy::new(Client::new); +static SANDBOX_URL: Lazy = Lazy::new(|| env::var("SANDBOX_URL").unwrap()); #[derive(Deserialize)] #[serde(rename_all = "camelCase")]