From 9d75afc8c181b5e0c0fda7236557967fb3365a93 Mon Sep 17 00:00:00 2001 From: trivernis Date: Sun, 10 Apr 2022 15:19:01 +0200 Subject: [PATCH] Remove log and switch to tracing Signed-off-by: trivernis --- Cargo.lock | 553 +++++++++++++++++----------------- Cargo.toml | 14 +- src/ephemeral_message.rs | 14 +- src/events/event_callbacks.rs | 24 +- src/events/handler.rs | 3 +- src/menu/container.rs | 2 +- src/menu/controls.rs | 20 +- src/menu/menu.rs | 51 ++-- 8 files changed, 339 insertions(+), 342 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 88a775c..13e16b3 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -10,9 +10,9 @@ checksum = "f26201604c87b1e01bd3d98f8d5d9a8fcbb815e8cedb41ffccbeb4bf593a35fe" [[package]] name = "async-trait" -version = "0.1.51" +version = "0.1.53" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "44318e776df68115a881de9a8fd1b9e53368d7a4a5ce4cc48517da3393233a5e" +checksum = "ed6aa3524a2dfcf9fe180c51eae2b58738348d819517ceadf95789c51fff7600" dependencies = [ "proc-macro2", "quote", @@ -32,16 +32,16 @@ dependencies = [ "pin-project", "tokio", "tokio-native-tls", - "tokio-rustls", + "tokio-rustls 0.22.0", "tungstenite", "webpki-roots 0.20.0", ] [[package]] name = "autocfg" -version = "1.0.1" +version = "1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cdb031dd78e28731d87d56cc8ffef4a8f36ca26c38fe2de700543e627f8a464a" +checksum = "d468802bab17cbc0cc575e9b053f41e72aa36bfa6b7f55e3529ffa43161b97fa" [[package]] name = "base64" @@ -72,9 +72,9 @@ dependencies = [ [[package]] name = "bumpalo" -version = "3.7.1" +version = "3.9.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d9df67f7bf9ef8498769f994239c45613ef0c5899415fb58e9add412d2c1a538" +checksum = "a4a45a46ab1f2412e53d3a0ade76ffad2025804294569aae387231a0cd6e0899" [[package]] name = "byteorder" @@ -96,9 +96,9 @@ checksum = "c4872d67bab6358e59559027aa3b9157c53d9358c51423c17554809a8858e0f8" [[package]] name = "cc" -version = "1.0.70" +version = "1.0.73" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d26a6ce4b6a484fa3edb70f7efa6fc430fd2b87285fe8b84304fd0936faa0dc0" +checksum = "2fff2a6927b3bb87f9595d67196a70493f627687a71d87a0d692242c33f58c11" [[package]] name = "cfg-if" @@ -116,15 +116,14 @@ dependencies = [ "num-integer", "num-traits", "serde", - "time", "winapi", ] [[package]] name = "core-foundation" -version = "0.9.1" +version = "0.9.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0a89e2ae426ea83155dccf10c0fa6b1463ef6d5fcb44cee0b224a408fa640a62" +checksum = "194a7a9e6de53fa55116934067c844d9d749312f75c6f6d0980e8c252f8c2146" dependencies = [ "core-foundation-sys", "libc", @@ -132,24 +131,24 @@ dependencies = [ [[package]] name = "core-foundation-sys" -version = "0.8.2" +version = "0.8.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ea221b5284a47e40033bf9b66f35f984ec0ea2931eb03505246cd27a963f981b" +checksum = "5827cebf4670468b8772dd191856768aedcb1b0278a04f989f7766351917b9dc" [[package]] name = "cpufeatures" -version = "0.2.1" +version = "0.2.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "95059428f66df56b63431fdb4e1947ed2190586af5c5a8a8b71122bdf5a7f469" +checksum = "59a6001667ab124aebae2a495118e11d30984c3a653e99d86d58971708cf5e4b" dependencies = [ "libc", ] [[package]] name = "crc32fast" -version = "1.2.1" +version = "1.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "81156fece84ab6a9f2afdb109ce3ae577e42b1228441eded99bd77f627953b1a" +checksum = "b540bd8bc810d3885c6ea91e2018302f68baba2129ab3e88f32389ee9370880d" dependencies = [ "cfg-if", ] @@ -165,13 +164,22 @@ dependencies = [ [[package]] name = "encoding_rs" -version = "0.8.28" +version = "0.8.31" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "80df024fbc5ac80f87dfef0d9f5209a252f2a497f7f42944cff24d8253cac065" +checksum = "9852635589dc9f9ea1b6fe9f05b50ef208c85c834a562f0c6abb1c475736ec2b" dependencies = [ "cfg-if", ] +[[package]] +name = "fastrand" +version = "1.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c3fcf0cee53519c866c09b5de1f6c56ff9d647101f81c1964fa632e148896cdf" +dependencies = [ + "instant", +] + [[package]] name = "flate2" version = "1.0.22" @@ -217,9 +225,9 @@ dependencies = [ [[package]] name = "futures" -version = "0.3.17" +version = "0.3.21" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a12aa0eb539080d55c3f2d45a67c3b58b6b0773c1a3ca2dfec66d58c97fd66ca" +checksum = "f73fe65f54d1e12b726f517d3e2135ca3125a437b6d998caf1962961f7172d9e" dependencies = [ "futures-channel", "futures-core", @@ -232,9 +240,9 @@ dependencies = [ [[package]] name = "futures-channel" -version = "0.3.17" +version = "0.3.21" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5da6ba8c3bb3c165d3c7319fc1cc8304facf1fb8db99c5de877183c08a273888" +checksum = "c3083ce4b914124575708913bca19bfe887522d6e2e6d0952943f5eac4a74010" dependencies = [ "futures-core", "futures-sink", @@ -242,15 +250,15 @@ dependencies = [ [[package]] name = "futures-core" -version = "0.3.17" +version = "0.3.21" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "88d1c26957f23603395cd326b0ffe64124b818f4449552f960d815cfba83a53d" +checksum = "0c09fd04b7e4073ac7156a9539b57a484a8ea920f79c7c675d05d289ab6110d3" [[package]] name = "futures-executor" -version = "0.3.17" +version = "0.3.21" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "45025be030969d763025784f7f355043dc6bc74093e4ecc5000ca4dc50d8745c" +checksum = "9420b90cfa29e327d0429f19be13e7ddb68fa1cccb09d65e5706b8c7a749b8a6" dependencies = [ "futures-core", "futures-task", @@ -259,18 +267,16 @@ dependencies = [ [[package]] name = "futures-io" -version = "0.3.17" +version = "0.3.21" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "522de2a0fe3e380f1bc577ba0474108faf3f6b18321dbf60b3b9c39a75073377" +checksum = "fc4045962a5a5e935ee2fdedaa4e08284547402885ab326734432bed5d12966b" [[package]] name = "futures-macro" -version = "0.3.17" +version = "0.3.21" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "18e4a4b95cea4b4ccbcf1c5675ca7c4ee4e9e75eb79944d07defde18068f79bb" +checksum = "33c1e13800337f4d4d7a316bf45a567dbcb6ffe087f16424852d97e97a91f512" dependencies = [ - "autocfg", - "proc-macro-hack", "proc-macro2", "quote", "syn", @@ -278,23 +284,22 @@ dependencies = [ [[package]] name = "futures-sink" -version = "0.3.17" +version = "0.3.21" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "36ea153c13024fe480590b3e3d4cad89a0cfacecc24577b68f86c6ced9c2bc11" +checksum = "21163e139fa306126e6eedaf49ecdb4588f939600f0b1e770f4205ee4b7fa868" [[package]] name = "futures-task" -version = "0.3.17" +version = "0.3.21" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1d3d00f4eddb73e498a54394f228cd55853bdf059259e8e7bc6e69d408892e99" +checksum = "57c66a976bf5909d801bbef33416c41372779507e7a6b3a5e25e4749c58f776a" [[package]] name = "futures-util" -version = "0.3.17" +version = "0.3.21" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "36568465210a3a6ee45e1f165136d68671471a501e632e9a98d96872222b5481" +checksum = "d8b7abd5d659d9b90c8cba917f6ec750a74e2dc23902ef9cd4cc8c8b22e6036a" dependencies = [ - "autocfg", "futures-channel", "futures-core", "futures-io", @@ -304,16 +309,14 @@ dependencies = [ "memchr", "pin-project-lite", "pin-utils", - "proc-macro-hack", - "proc-macro-nested", "slab", ] [[package]] name = "generic-array" -version = "0.14.4" +version = "0.14.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "501466ecc8a30d1d3b7fc9229b122b2ce8ed6e9d9223f1138d4babb253e51817" +checksum = "fd48d33ec7f05fbfa152300fdad764757cbded343c1aa1cff2fbaf4134851803" dependencies = [ "typenum", "version_check", @@ -330,22 +333,11 @@ dependencies = [ "wasi 0.9.0+wasi-snapshot-preview1", ] -[[package]] -name = "getrandom" -version = "0.2.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7fcd999463524c52659517fe2cea98493cfe485d10565e7b0fb07dbba7ad2753" -dependencies = [ - "cfg-if", - "libc", - "wasi 0.10.2+wasi-snapshot-preview1", -] - [[package]] name = "h2" -version = "0.3.4" +version = "0.3.13" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d7f3675cfef6a30c8031cf9e6493ebdc3bb3272a3fea3923c4210d1830e6a472" +checksum = "37a82c6d637fc9515a4694bbf1cb2457b79d81ce52b3108bdeea58b07dd34a57" dependencies = [ "bytes 1.1.0", "fnv", @@ -356,7 +348,7 @@ dependencies = [ "indexmap", "slab", "tokio", - "tokio-util", + "tokio-util 0.7.1", "tracing", ] @@ -368,9 +360,9 @@ checksum = "ab5ef0d4909ef3724cc8cce6ccc8572c5c817592e9285f5464f8e86f8bd3726e" [[package]] name = "http" -version = "0.2.5" +version = "0.2.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1323096b05d41827dadeaee54c9981958c0f94e670bc94ed80037d1a7b8b186b" +checksum = "31f4c6746584866f0feabcc69893c5b51beef3831656a968ed7ae254cdc4fd03" dependencies = [ "bytes 1.1.0", "fnv", @@ -379,9 +371,9 @@ dependencies = [ [[package]] name = "http-body" -version = "0.4.3" +version = "0.4.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "399c583b2979440c60be0821a6199eca73bc3c8dcd9d070d75ac726e2c6186e5" +checksum = "1ff4f84919677303da5f147645dbea6b1881f368d03ac84e1dc09031ebd7b2c6" dependencies = [ "bytes 1.1.0", "http", @@ -390,21 +382,21 @@ dependencies = [ [[package]] name = "httparse" -version = "1.5.1" +version = "1.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "acd94fdbe1d4ff688b67b04eee2e17bd50995534a61539e45adfefb45e5e5503" +checksum = "9100414882e15fb7feccb4897e5f0ff0ff1ca7d1a86a23208ada4d7a18e6c6c4" [[package]] name = "httpdate" -version = "1.0.1" +version = "1.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6456b8a6c8f33fee7d958fcd1b60d55b11940a79e63ae87013e6d22e26034440" +checksum = "c4a1e36c821dbe04574f602848a19f742f4fb3c98d40449f11bcad18d6b17421" [[package]] name = "hyper" -version = "0.14.13" +version = "0.14.18" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "15d1cfb9e4f68655fa04c01f59edb405b6074a0f7118ea881e5026e4a1cd8593" +checksum = "b26ae0a80afebe130861d90abf98e3814a4f28a4c6ffeb5ab8ebb2be311e0ef2" dependencies = [ "bytes 1.1.0", "futures-channel", @@ -426,17 +418,15 @@ dependencies = [ [[package]] name = "hyper-rustls" -version = "0.22.1" +version = "0.23.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5f9f7a97316d44c0af9b0301e65010573a853a9fc97046d7331d7f6bc0fd5a64" +checksum = "d87c48c02e0dc5e3b849a2041db3029fd066650f8f717c07bf8ed78ccb895cac" dependencies = [ - "futures-util", + "http", "hyper", - "log", - "rustls", + "rustls 0.20.4", "tokio", - "tokio-rustls", - "webpki", + "tokio-rustls 0.23.3", ] [[package]] @@ -465,9 +455,9 @@ dependencies = [ [[package]] name = "indexmap" -version = "1.7.0" +version = "1.8.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bc633605454125dec4b66843673f01c7df2b89479b32e0ed634e43a91cff62a5" +checksum = "0f647032dfaa1f8b6dc29bd3edb7bbef4861b8b8007ebb118d6db284fd59f6ee" dependencies = [ "autocfg", "hashbrown", @@ -482,23 +472,32 @@ dependencies = [ "bytes 0.5.6", ] +[[package]] +name = "instant" +version = "0.1.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7a5bbe824c507c5da5956355e86a746d82e0e1464f65d862cc5e71da70e94b2c" +dependencies = [ + "cfg-if", +] + [[package]] name = "ipnet" -version = "2.3.1" +version = "2.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "68f2d64f2edebec4ce84ad108148e67e1064789bee435edc5b60ad398714a3a9" +checksum = "35e70ee094dc02fd9c13fdad4940090f22dbd6ac7c9e7094a46cf0232a50bc7c" [[package]] name = "itoa" -version = "0.4.8" +version = "1.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b71991ff56294aa922b450139ee08b3bfc70982c6b2c7562771375cf73542dd4" +checksum = "1aab8fc367588b89dcee83ab0fd66b72b50b72fa1904d7095045ace2b0c81c35" [[package]] name = "js-sys" -version = "0.3.55" +version = "0.3.57" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7cc9ffccd38c451a86bf13657df244e9c3f37493cce8e5e21e940963777acc84" +checksum = "671a26f820db17c2a2750743f1dd03bafd15b98c9f30c7c2628c024c05d73397" dependencies = [ "wasm-bindgen", ] @@ -511,15 +510,15 @@ checksum = "e2abad23fbc42b3700f2f279844dc832adb2b2eb069b2df918f455c4e18cc646" [[package]] name = "libc" -version = "0.2.102" +version = "0.2.122" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a2a5ac8f984bfcf3a823267e5fde638acc3325f6496633a5da6bb6eb2171e103" +checksum = "ec647867e2bf0772e28c8bcde4f0d19a9216916e890543b5a03ed8ef27b8f259" [[package]] name = "log" -version = "0.4.14" +version = "0.4.16" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "51b9bbe6c47d51fc3e1a9b945965946b4c44142ab8792c50835a980d362c2710" +checksum = "6389c490849ff5bc16be905ae24bc913a9c8892e19b2341dbc175e14c341c2b8" dependencies = [ "cfg-if", ] @@ -544,9 +543,9 @@ checksum = "2a60c7ce501c71e03a9c9c0d35b861413ae925bd979cc7a4e30d060069aaac8d" [[package]] name = "mime_guess" -version = "2.0.3" +version = "2.0.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2684d4c2e97d99848d30b324b00c8fcc7e5c897b7cbb5819b09e7c90e8baf212" +checksum = "4192263c238a5f0d0c6bfd21f336a313a4ce1c450542449ca191bb657b4642ef" dependencies = [ "mime", "unicase", @@ -564,14 +563,15 @@ dependencies = [ [[package]] name = "mio" -version = "0.7.13" +version = "0.8.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8c2bdb6314ec10835cd3293dd268473a835c02b7b352e788be788b3c6ca6bb16" +checksum = "52da4364ffb0e4fe33a9841a98a3f3014fb964045ce4f7a45a398243c8d6b0c9" dependencies = [ "libc", "log", "miow", "ntapi", + "wasi 0.11.0+wasi-snapshot-preview1", "winapi", ] @@ -586,9 +586,9 @@ dependencies = [ [[package]] name = "native-tls" -version = "0.2.8" +version = "0.2.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "48ba9f7719b5a0f42f338907614285fb5fd70e53858141f69898a1fb7203b24d" +checksum = "fd7e2f3618557f980e0b17e8856252eee3c97fa12c54dff0ca290fb6266ca4a9" dependencies = [ "lazy_static", "libc", @@ -604,9 +604,9 @@ dependencies = [ [[package]] name = "ntapi" -version = "0.3.6" +version = "0.3.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3f6bb902e437b6d86e03cce10a7e2af662292c5dfef23b65899ea3ac9354ad44" +checksum = "c28774a7fd2fbb4f0babd8237ce554b73af68021b5f695a3cebd6c59bac0980f" dependencies = [ "winapi", ] @@ -632,9 +632,9 @@ dependencies = [ [[package]] name = "once_cell" -version = "1.8.0" +version = "1.10.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "692fcb63b64b1758029e0a96ee63e049ce8c5948587f2f7208df04625e5f6b56" +checksum = "87f3e037eac156d1775da914196f0f37741a274155e34a0b7e427c35d2a2ecb9" [[package]] name = "opaque-debug" @@ -644,9 +644,9 @@ checksum = "624a8340c38c1b80fd549087862da4ba43e08858af025b236e509b6649fc13d5" [[package]] name = "openssl" -version = "0.10.36" +version = "0.10.38" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8d9facdb76fec0b73c406f125d44d86fdad818d66fef0531eec9233ca425ff4a" +checksum = "0c7ae222234c30df141154f159066c5093ff73b63204dcda7121eb082fc56a95" dependencies = [ "bitflags", "cfg-if", @@ -658,15 +658,15 @@ dependencies = [ [[package]] name = "openssl-probe" -version = "0.1.4" +version = "0.1.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "28988d872ab76095a6e6ac88d99b54fd267702734fd7ffe610ca27f533ddb95a" +checksum = "ff011a302c396a5197692431fc1948019154afc178baf7d8e37367442a4601cf" [[package]] name = "openssl-sys" -version = "0.9.67" +version = "0.9.72" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "69df2d8dfc6ce3aaf44b40dec6f487d5a886516cf6879c49e98e0710f310a058" +checksum = "7e46109c383602735fa0a2e48dd2b7c892b048e1bf69e5c3b1d804b7d9c203cb" dependencies = [ "autocfg", "cc", @@ -683,18 +683,18 @@ checksum = "d4fd5641d01c8f18a23da7b6fe29298ff4b55afcccdf78973b24cf3175fee32e" [[package]] name = "pin-project" -version = "1.0.8" +version = "1.0.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "576bc800220cc65dac09e99e97b08b358cfab6e17078de8dc5fee223bd2d0c08" +checksum = "58ad3879ad3baf4e44784bc6a718a8698867bb991f8ce24d1bcbe2cfb4c3a75e" dependencies = [ "pin-project-internal", ] [[package]] name = "pin-project-internal" -version = "1.0.8" +version = "1.0.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6e8fe8163d14ce7f0cdac2e040116f22eac817edabff0be91e8aff7e9accf389" +checksum = "744b6f092ba29c3650faf274db506afd39944f48420f6c86b17cfe0ee1cb36bb" dependencies = [ "proc-macro2", "quote", @@ -703,9 +703,9 @@ dependencies = [ [[package]] name = "pin-project-lite" -version = "0.2.7" +version = "0.2.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8d31d11c69a6b52a174b42bdc0c30e5e11670f90788b2c471c31c1d17d449443" +checksum = "e280fbe77cc62c91527259e9442153f4688736748d24660126286329742b4c6c" [[package]] name = "pin-utils" @@ -715,42 +715,30 @@ checksum = "8b870d8c151b6f2fb93e84a13146138f05d02ed11c7e7c54f8826aaaf7c9f184" [[package]] name = "pkg-config" -version = "0.3.19" +version = "0.3.25" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3831453b3449ceb48b6d9c7ad7c96d5ea673e9b470a1dc578c2ce6521230884c" +checksum = "1df8c4ec4b0627e53bdf214615ad287367e482558cf84b109250b37464dc03ae" [[package]] name = "ppv-lite86" -version = "0.2.10" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ac74c624d6b2d21f425f752262f42188365d7b8ff1aff74c82e45136510a4857" - -[[package]] -name = "proc-macro-hack" -version = "0.5.19" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dbf0c48bc1d91375ae5c3cd81e3722dff1abcf81a30960240640d223f59fe0e5" - -[[package]] -name = "proc-macro-nested" -version = "0.1.7" +version = "0.2.16" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bc881b2c22681370c6a780e47af9840ef841837bc98118431d4e1868bd0c1086" +checksum = "eb9f9e6e233e5c4a35559a617bf40a4ec447db2e84c20b55a6f83167b7e57872" [[package]] name = "proc-macro2" -version = "1.0.29" +version = "1.0.37" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b9f5105d4fdaab20335ca9565e106a5d9b82b6219b5ba735731124ac6711d23d" +checksum = "ec757218438d5fda206afc041538b2f6d889286160d649a86a24d37e1235afd1" dependencies = [ "unicode-xid", ] [[package]] name = "quote" -version = "1.0.9" +version = "1.0.17" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c3d0b9745dc2debf507c8422de05d7226cc1f0644216dfdfead988f9b1ab32a7" +checksum = "632d02bff7f874a36f33ea8bb416cd484b90cc66c1194b1a1110d067a7013f58" dependencies = [ "proc-macro2", ] @@ -761,23 +749,11 @@ version = "0.7.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6a6b1679d49b24bbfe0c803429aa1874472f50d9b363131f0e89fc356b544d03" dependencies = [ - "getrandom 0.1.16", - "libc", - "rand_chacha 0.2.2", - "rand_core 0.5.1", - "rand_hc 0.2.0", -] - -[[package]] -name = "rand" -version = "0.8.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2e7573632e6454cf6b99d7aac4ccca54be06da05aca2ef7423d22d27d4d4bcd8" -dependencies = [ + "getrandom", "libc", - "rand_chacha 0.3.1", - "rand_core 0.6.3", - "rand_hc 0.3.1", + "rand_chacha", + "rand_core", + "rand_hc", ] [[package]] @@ -787,17 +763,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f4c8ed856279c9737206bf725bf36935d8666ead7aa69b52be55af369d193402" dependencies = [ "ppv-lite86", - "rand_core 0.5.1", -] - -[[package]] -name = "rand_chacha" -version = "0.3.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e6c10a63a0fa32252be49d21e7709d4d4baf8d231c2dbce1eaa8141b9b127d88" -dependencies = [ - "ppv-lite86", - "rand_core 0.6.3", + "rand_core", ] [[package]] @@ -806,16 +772,7 @@ version = "0.5.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "90bde5296fc891b0cef12a6d03ddccc162ce7b2aff54160af9338f8d40df6d19" dependencies = [ - "getrandom 0.1.16", -] - -[[package]] -name = "rand_core" -version = "0.6.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d34f1408f55294453790c48b2f1ebbb1c5b4b7563eb1f418bcfcfdbb06ebb4e7" -dependencies = [ - "getrandom 0.2.3", + "getrandom", ] [[package]] @@ -824,23 +781,14 @@ version = "0.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ca3129af7b92a17112d59ad498c6f81eaf463253766b90396d39ea7a39d6613c" dependencies = [ - "rand_core 0.5.1", -] - -[[package]] -name = "rand_hc" -version = "0.3.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d51e9f596de227fda2ea6c84607f5558e196eeaf43c986b724ba4fb8fdf497e7" -dependencies = [ - "rand_core 0.6.3", + "rand_core", ] [[package]] name = "redox_syscall" -version = "0.2.10" +version = "0.2.13" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8383f39639269cde97d255a32bdb68c047337295414940c68bdd30c2e13203ff" +checksum = "62f25bc4c7e55e0b0b7a1d43fb893f4fa1361d0abe38b9ce4f323c2adfe6ef42" dependencies = [ "bitflags", ] @@ -856,15 +804,16 @@ dependencies = [ [[package]] name = "reqwest" -version = "0.11.4" +version = "0.11.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "246e9f61b9bb77df069a947682be06e31ac43ea37862e244a69f177694ea6d22" +checksum = "46a1f7aa4f35e5e8b4160449f51afc758f0ce6454315a9fa7d0d113e958c41eb" dependencies = [ "base64 0.13.0", "bytes 1.1.0", "encoding_rs", "futures-core", "futures-util", + "h2", "http", "http-body", "hyper", @@ -879,18 +828,20 @@ dependencies = [ "native-tls", "percent-encoding", "pin-project-lite", - "rustls", + "rustls 0.20.4", + "rustls-pemfile", "serde", "serde_json", "serde_urlencoded", "tokio", "tokio-native-tls", - "tokio-rustls", + "tokio-rustls 0.23.3", + "tokio-util 0.6.9", "url", "wasm-bindgen", "wasm-bindgen-futures", "web-sys", - "webpki-roots 0.21.1", + "webpki-roots 0.22.3", "winreg", ] @@ -918,15 +869,36 @@ dependencies = [ "base64 0.13.0", "log", "ring", - "sct", - "webpki", + "sct 0.6.1", + "webpki 0.21.4", +] + +[[package]] +name = "rustls" +version = "0.20.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4fbfeb8d0ddb84706bc597a5574ab8912817c52a397f819e5b614e2265206921" +dependencies = [ + "log", + "ring", + "sct 0.7.0", + "webpki 0.22.0", +] + +[[package]] +name = "rustls-pemfile" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1ee86d63972a7c661d1536fefe8c3c8407321c3df668891286de28abcd087360" +dependencies = [ + "base64 0.13.0", ] [[package]] name = "ryu" -version = "1.0.5" +version = "1.0.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "71d301d4193d031abdd79ff7e3dd721168a9572ef3fe51a1517aba235bd8f86e" +checksum = "73b4b750c782965c211b42f022f59af1fbceabdd026623714f104152f1ec149f" [[package]] name = "schannel" @@ -948,11 +920,21 @@ dependencies = [ "untrusted", ] +[[package]] +name = "sct" +version = "0.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d53dcdb7c9f8158937a7981b48accfd39a43af418591a5d008c7b22b5e1b7ca4" +dependencies = [ + "ring", + "untrusted", +] + [[package]] name = "security-framework" -version = "2.4.2" +version = "2.6.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "525bc1abfda2e1998d152c45cf13e696f76d0a4972310b22fac1658b05df7c87" +checksum = "2dc14f172faf8a0194a3aded622712b0de276821addc574fa54fc0a1167e10dc" dependencies = [ "bitflags", "core-foundation", @@ -963,9 +945,9 @@ dependencies = [ [[package]] name = "security-framework-sys" -version = "2.4.2" +version = "2.6.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a9dd14d83160b528b7bfd66439110573efcfbe281b17fc2ca9f39f550d619c7e" +checksum = "0160a13a177a45bfb43ce71c01580998474f556ad854dcbca936dd2841a5c556" dependencies = [ "core-foundation-sys", "libc", @@ -973,18 +955,18 @@ dependencies = [ [[package]] name = "serde" -version = "1.0.130" +version = "1.0.136" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f12d06de37cf59146fbdecab66aa99f9fe4f78722e3607577a5375d66bd0c913" +checksum = "ce31e24b01e1e524df96f1c2fdd054405f8d7376249a5110886fb4b658484789" dependencies = [ "serde_derive", ] [[package]] name = "serde_derive" -version = "1.0.130" +version = "1.0.136" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d7bc1a1ab1961464eae040d96713baa5a724a8152c1222492465b54322ec508b" +checksum = "08597e7152fcd306f41838ed3e37be9eaeed2b61c42e2117266a554fab4662f9" dependencies = [ "proc-macro2", "quote", @@ -993,9 +975,9 @@ dependencies = [ [[package]] name = "serde_json" -version = "1.0.68" +version = "1.0.79" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0f690853975602e1bfe1ccbf50504d67174e3bcf340f23b5ea9992e0587a52d8" +checksum = "8e8d9fa5c3b304765ce1fd9c4c8a3de2c8db365a5b91be52f186efc675681d95" dependencies = [ "itoa", "ryu", @@ -1004,9 +986,9 @@ dependencies = [ [[package]] name = "serde_urlencoded" -version = "0.7.0" +version = "0.7.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "edfa57a7f8d9c1d260a549e7224100f6c43d43f9103e06dd8b4095a9b2b43ce9" +checksum = "d3491c14715ca2294c4d6a88f15e84739788c1d030eed8c110436aafdaa2f3fd" dependencies = [ "form_urlencoded", "itoa", @@ -1016,9 +998,9 @@ dependencies = [ [[package]] name = "serenity" -version = "0.10.9" +version = "0.10.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6275d443266aedf2be507a245ddc23db0c07b1b99774e16f3c879e96a78b067a" +checksum = "dde86919535c6047e055d512641c5241320c01cb8fee54f1e5ba77c939a0ec23" dependencies = [ "async-trait", "async-tungstenite", @@ -1043,11 +1025,11 @@ name = "serenity-rich-interaction" version = "0.2.6" dependencies = [ "futures", - "log", "serde_json", "serenity", "thiserror", "tokio", + "tracing", ] [[package]] @@ -1065,15 +1047,15 @@ dependencies = [ [[package]] name = "slab" -version = "0.4.4" +version = "0.4.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c307a32c1c5c437f38c7fd45d753050587732ba8628319fbdf12a7e289ccc590" +checksum = "eb703cfe953bccee95685111adeedb76fabe4e97549a58d16f03ea7b9367bb32" [[package]] name = "socket2" -version = "0.4.2" +version = "0.4.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5dc90fe6c7be1a323296982db1836d1ea9e47b6839496dde9a541bc496df3516" +checksum = "66d72b759436ae32898a2af0a14218dbf55efde3feeb170eb623637db85ee1e0" dependencies = [ "libc", "winapi", @@ -1087,9 +1069,9 @@ checksum = "6e63cff320ae2c57904679ba7cb63280a3dc4613885beafb148ee7bf9aa9042d" [[package]] name = "syn" -version = "1.0.77" +version = "1.0.91" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5239bc68e0fef57495900cfea4e8dc75596d9a319d7e16b1e0a440d24e6fe0a0" +checksum = "b683b2b825c8eef438b77c36a06dc262294da3d5a5813fac20da149241dcd44d" dependencies = [ "proc-macro2", "quote", @@ -1098,13 +1080,13 @@ dependencies = [ [[package]] name = "tempfile" -version = "3.2.0" +version = "3.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dac1c663cfc93810f88aed9b8941d48cabf856a1b111c29a40439018d870eb22" +checksum = "5cdb1ef4eaeeaddc8fbd371e5017057064af0911902ef36b39801f67cc6d79e4" dependencies = [ "cfg-if", + "fastrand", "libc", - "rand 0.8.4", "redox_syscall", "remove_dir_all", "winapi", @@ -1112,39 +1094,29 @@ dependencies = [ [[package]] name = "thiserror" -version = "1.0.29" +version = "1.0.30" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "602eca064b2d83369e2b2f34b09c70b605402801927c65c11071ac911d299b88" +checksum = "854babe52e4df1653706b98fcfc05843010039b406875930a70e4d9644e5c417" dependencies = [ "thiserror-impl", ] [[package]] name = "thiserror-impl" -version = "1.0.29" +version = "1.0.30" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bad553cc2c78e8de258400763a647e80e6d1b31ee237275d756f6836d204494c" +checksum = "aa32fd3f627f367fe16f893e2597ae3c05020f8bba2666a4e6ea73d377e5714b" dependencies = [ "proc-macro2", "quote", "syn", ] -[[package]] -name = "time" -version = "0.1.43" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ca8a50ef2360fbd1eeb0ecd46795a87a19024eb4b53c5dc916ca1fd95fe62438" -dependencies = [ - "libc", - "winapi", -] - [[package]] name = "tinyvec" -version = "1.5.0" +version = "1.5.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f83b2a3d4d9091d0abd7eba4dc2710b1718583bd4d8992e2190720ea38f391f7" +checksum = "2c1c1d5a42b6245520c249549ec267180beaffcc0615401ac8e31853d4b6d8d2" dependencies = [ "tinyvec_macros", ] @@ -1157,25 +1129,25 @@ checksum = "cda74da7e1a664f795bb1f8a87ec406fb89a02522cf6e50620d016add6dbbf5c" [[package]] name = "tokio" -version = "1.12.0" +version = "1.17.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c2c2416fdedca8443ae44b4527de1ea633af61d8f7169ffa6e72c5b53d24efcc" +checksum = "2af73ac49756f3f7c01172e34a23e5d0216f6c32333757c2c61feb2bbff5a5ee" dependencies = [ - "autocfg", "bytes 1.1.0", "libc", "memchr", "mio", "pin-project-lite", + "socket2", "tokio-macros", "winapi", ] [[package]] name = "tokio-macros" -version = "1.3.0" +version = "1.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "54473be61f4ebe4efd09cec9bd5d16fa51d70ea0192213d754d2d500457db110" +checksum = "b557f72f448c511a979e2564e55d74e6c4432fc96ff4f6241bc6bded342643b7" dependencies = [ "proc-macro2", "quote", @@ -1198,16 +1170,27 @@ version = "0.22.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "bc6844de72e57df1980054b38be3a9f4702aba4858be64dd700181a8a6d0e1b6" dependencies = [ - "rustls", + "rustls 0.19.1", + "tokio", + "webpki 0.21.4", +] + +[[package]] +name = "tokio-rustls" +version = "0.23.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4151fda0cf2798550ad0b34bcfc9b9dcc2a9d2471c895c68f3a8818e54f2389e" +dependencies = [ + "rustls 0.20.4", "tokio", - "webpki", + "webpki 0.22.0", ] [[package]] name = "tokio-util" -version = "0.6.8" +version = "0.6.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "08d3725d3efa29485e87311c5b699de63cde14b00ed4d256b8318aa30ca452cd" +checksum = "9e99e1983e5d376cd8eb4b66604d2e99e79f5bd988c3055891dcd8c9e2604cc0" dependencies = [ "bytes 1.1.0", "futures-core", @@ -1217,6 +1200,20 @@ dependencies = [ "tokio", ] +[[package]] +name = "tokio-util" +version = "0.7.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0edfdeb067411dba2044da6d1cb2df793dd35add7888d73c16e3381ded401764" +dependencies = [ + "bytes 1.1.0", + "futures-core", + "futures-sink", + "pin-project-lite", + "tokio", + "tracing", +] + [[package]] name = "tower-service" version = "0.3.1" @@ -1225,9 +1222,9 @@ checksum = "360dfd1d6d30e05fda32ace2c8c70e9c0a9da713275777f5a4dbb8a1893930c6" [[package]] name = "tracing" -version = "0.1.28" +version = "0.1.33" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "84f96e095c0c82419687c20ddf5cb3eadb61f4e1405923c9dc8e53a1adacbda8" +checksum = "80b9fa4360528139bc96100c160b7ae879f5567f49f1782b0b02035b0358ebf3" dependencies = [ "cfg-if", "log", @@ -1238,9 +1235,9 @@ dependencies = [ [[package]] name = "tracing-attributes" -version = "0.1.16" +version = "0.1.20" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "98863d0dd09fa59a1b79c6750ad80dbda6b75f4e71c437a6a1a8cb91a8bcbd77" +checksum = "2e65ce065b4b5c53e73bb28912318cb8c9e9ad3921f1d669eb0e68b4c8143a2b" dependencies = [ "proc-macro2", "quote", @@ -1249,9 +1246,9 @@ dependencies = [ [[package]] name = "tracing-core" -version = "0.1.20" +version = "0.1.24" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "46125608c26121c81b0c6d693eab5a420e416da7e43c426d2e8f7df8da8a3acf" +checksum = "90442985ee2f57c9e1b548ee72ae842f4a9a20e3f417cc38dbc5dc684d9bb4ee" dependencies = [ "lazy_static", ] @@ -1276,7 +1273,7 @@ dependencies = [ "input_buffer", "log", "native-tls", - "rand 0.7.3", + "rand", "sha-1", "url", "utf-8", @@ -1290,9 +1287,9 @@ checksum = "ed5b74f0a24b5454580a79abb6994393b09adf0ab8070f15827cb666255de155" [[package]] name = "typenum" -version = "1.14.0" +version = "1.15.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b63708a265f51345575b27fe43f9500ad611579e764c79edbc2037b1121959ec" +checksum = "dcf81ac59edc17cc8697ff311e8f5ef2d99fcbd9817b34cec66f90b6c3dfd987" [[package]] name = "unicase" @@ -1305,9 +1302,9 @@ dependencies = [ [[package]] name = "unicode-bidi" -version = "0.3.6" +version = "0.3.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "246f4c42e67e7a4e3c6106ff716a5d067d4132a642840b242e357e468a2a0085" +checksum = "1a01404663e3db436ed2746d9fefef640d868edae3cceb81c3b8d5732fda678f" [[package]] name = "unicode-normalization" @@ -1356,9 +1353,9 @@ checksum = "accd4ea62f7bb7a82fe23066fb0957d48ef677f6eeb8215f372f52e48bb32426" [[package]] name = "version_check" -version = "0.9.3" +version = "0.9.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5fecdca9a5291cc2b8dcf7dc02453fee791a280f3743cb0905f8822ae463b3fe" +checksum = "49874b5167b65d7193b8aba1567f5c7d93d001cafc34600cee003eda787e483f" [[package]] name = "want" @@ -1378,27 +1375,25 @@ checksum = "cccddf32554fecc6acb585f82a32a72e28b48f8c4c1883ddfeeeaa96f7d8e519" [[package]] name = "wasi" -version = "0.10.2+wasi-snapshot-preview1" +version = "0.11.0+wasi-snapshot-preview1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fd6fbd9a79829dd1ad0cc20627bf1ed606756a7f77edff7b66b7064f9cb327c6" +checksum = "9c8d87e72b64a3b4db28d11ce29237c246188f4f51057d65a7eab63b7987e423" [[package]] name = "wasm-bindgen" -version = "0.2.78" +version = "0.2.80" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "632f73e236b219150ea279196e54e610f5dbafa5d61786303d4da54f84e47fce" +checksum = "27370197c907c55e3f1a9fbe26f44e937fe6451368324e009cba39e139dc08ad" dependencies = [ "cfg-if", - "serde", - "serde_json", "wasm-bindgen-macro", ] [[package]] name = "wasm-bindgen-backend" -version = "0.2.78" +version = "0.2.80" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a317bf8f9fba2476b4b2c85ef4c4af8ff39c3c7f0cdfeed4f82c34a880aa837b" +checksum = "53e04185bfa3a779273da532f5025e33398409573f348985af9a1cbf3774d3f4" dependencies = [ "bumpalo", "lazy_static", @@ -1411,9 +1406,9 @@ dependencies = [ [[package]] name = "wasm-bindgen-futures" -version = "0.4.28" +version = "0.4.30" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8e8d7523cb1f2a4c96c1317ca690031b714a51cc14e05f712446691f413f5d39" +checksum = "6f741de44b75e14c35df886aff5f1eb73aa114fa5d4d00dcd37b5e01259bf3b2" dependencies = [ "cfg-if", "js-sys", @@ -1423,9 +1418,9 @@ dependencies = [ [[package]] name = "wasm-bindgen-macro" -version = "0.2.78" +version = "0.2.80" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d56146e7c495528bf6587663bea13a8eb588d39b36b679d83972e1a2dbbdacf9" +checksum = "17cae7ff784d7e83a2fe7611cfe766ecf034111b49deb850a3dc7699c08251f5" dependencies = [ "quote", "wasm-bindgen-macro-support", @@ -1433,9 +1428,9 @@ dependencies = [ [[package]] name = "wasm-bindgen-macro-support" -version = "0.2.78" +version = "0.2.80" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7803e0eea25835f8abdc585cd3021b3deb11543c6fe226dcd30b228857c5c5ab" +checksum = "99ec0dc7a4756fffc231aab1b9f2f578d23cd391390ab27f952ae0c9b3ece20b" dependencies = [ "proc-macro2", "quote", @@ -1446,15 +1441,15 @@ dependencies = [ [[package]] name = "wasm-bindgen-shared" -version = "0.2.78" +version = "0.2.80" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0237232789cf037d5480773fe568aac745bfe2afbc11a863e97901780a6b47cc" +checksum = "d554b7f530dee5964d9a9468d95c1f8b8acae4f282807e7d27d4b03099a46744" [[package]] name = "web-sys" -version = "0.3.55" +version = "0.3.57" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "38eb105f1c59d9eaa6b5cdc92b859d85b926e82cb2e0945cd0c9259faa6fe9fb" +checksum = "7b17e741662c70c8bd24ac5c5b18de314a2c26c32bf8346ee1e6f53de919c283" dependencies = [ "js-sys", "wasm-bindgen", @@ -1470,22 +1465,32 @@ dependencies = [ "untrusted", ] +[[package]] +name = "webpki" +version = "0.22.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f095d78192e208183081cc07bc5515ef55216397af48b873e5edcd72637fa1bd" +dependencies = [ + "ring", + "untrusted", +] + [[package]] name = "webpki-roots" version = "0.20.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0f20dea7535251981a9670857150d571846545088359b28e4951d350bdaf179f" dependencies = [ - "webpki", + "webpki 0.21.4", ] [[package]] name = "webpki-roots" -version = "0.21.1" +version = "0.22.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "aabe153544e473b775453675851ecc86863d2a81d786d741f6b76778f2a48940" +checksum = "44d8de8415c823c8abd270ad483c6feeac771fad964890779f9a8cb24fbbc1bf" dependencies = [ - "webpki", + "webpki 0.22.0", ] [[package]] @@ -1512,9 +1517,9 @@ checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" [[package]] name = "winreg" -version = "0.7.0" +version = "0.10.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0120db82e8a1e0b9fb3345a539c478767c0048d842860994d96113d5b667bd69" +checksum = "80d0f4e272c85def139476380b12f9ac60926689dd2e01d4923222f40580869d" dependencies = [ "winapi", ] diff --git a/Cargo.toml b/Cargo.toml index 30f6dc4..16a3efc 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -16,13 +16,13 @@ rustls_backend = ["serenity/rustls_backend"] native_tls_backend = ["serenity/native_tls_backend"] [dependencies] -tokio = "1.4.0" -thiserror = "1.0.24" -log = "0.4.14" -futures = "0.3.14" -serde_json = "1.0.64" +tokio = "1.17.0" +thiserror = "1.0.30" +tracing= "0.1.33" +futures = "0.3.21" +serde_json = "1.0.79" [dependencies.serenity] -version = "0.10.5" +version = "0.10.10" default-features = false -features = ["builder", "http", "cache", "model", "client", "gateway"] \ No newline at end of file +features = ["builder", "http", "cache", "model", "client", "gateway"] diff --git a/src/ephemeral_message.rs b/src/ephemeral_message.rs index f24a57c..7d95f2e 100644 --- a/src/ephemeral_message.rs +++ b/src/ephemeral_message.rs @@ -10,6 +10,7 @@ use std::time::Duration; pub struct EphemeralMessage; impl EphemeralMessage { + #[tracing::instrument(level = "debug", skip(http, message))] /// Ensures that an already existing message is /// deleted after a certain amount of time pub async fn create_from_message( @@ -17,20 +18,20 @@ impl EphemeralMessage { message: &Message, timeout: Duration, ) -> Result<()> { - log::debug!("Creating ephemeral message from existing message"); + tracing::debug!("Creating ephemeral message from existing message"); let handle = MessageHandle::new(message.channel_id, message.id); let http = Arc::clone(&http); - log::debug!("Starting delete task"); + tracing::debug!("Starting delete task"); tokio::spawn(async move { - log::debug!("Waiting for timeout to pass"); + tracing::debug!("Waiting for timeout to pass"); tokio::time::sleep(timeout).await; - log::debug!("Deleting ephemeral message"); + tracing::debug!("Deleting ephemeral message"); if let Err(e) = http .delete_message(handle.channel_id, handle.message_id) .await { - log::error!("Failed to delete ephemeral message {:?}: {}", handle, e); + tracing::error!("Failed to delete ephemeral message {:?}: {}", handle, e); } }); @@ -38,6 +39,7 @@ impl EphemeralMessage { } /// Creates a new message that is deleted after a certain amount of time + #[tracing::instrument(level = "debug", skip(http, f))] pub async fn create<'a, F>( http: &Arc, channel_id: ChannelId, @@ -47,7 +49,7 @@ impl EphemeralMessage { where F: for<'b> FnOnce(&'b mut CreateMessage<'a>) -> &'b mut CreateMessage<'a>, { - log::debug!("Creating new ephemeral message"); + tracing::debug!("Creating new ephemeral message"); let msg = channel_id.send_message(http, f).await?; Self::create_from_message(http, &msg, timeout).await?; diff --git a/src/events/event_callbacks.rs b/src/events/event_callbacks.rs index 360a4c9..60fec82 100644 --- a/src/events/event_callbacks.rs +++ b/src/events/event_callbacks.rs @@ -10,6 +10,7 @@ use tokio::time::Duration; static UPDATE_INTERVAL_SECS: u64 = 5; /// Starts the loop to handle message updates +#[tracing::instrument(level = "debug", skip(ctx))] pub async fn start_update_loop(ctx: &Context) -> Result<()> { let event_messages = get_listeners_from_context(ctx) .await @@ -19,7 +20,7 @@ pub async fn start_update_loop(ctx: &Context) -> Result<()> { tokio::task::spawn(async move { loop { { - log::trace!("Locking listener from update loop."); + tracing::debug!("Updating messages..."); let messages = { let msgs_lock = event_messages.lock().await; @@ -28,13 +29,12 @@ pub async fn start_update_loop(ctx: &Context) -> Result<()> { .map(|(k, v)| (*k, v.clone())) .collect::>() }; - log::trace!("Listener locked."); let mut frozen_messages = Vec::new(); for (key, msg) in messages { let mut msg = msg.lock().await; if let Err(e) = msg.update(&http).await { - log::error!("Failed to update message: {:?}", e); + tracing::error!("Failed to update message: {:?}", e); } if msg.is_frozen() { frozen_messages.push(key); @@ -46,8 +46,8 @@ pub async fn start_update_loop(ctx: &Context) -> Result<()> { msgs_lock.remove(&key); } } + tracing::debug!("Messages updated"); } - log::trace!("Listener unlocked"); tokio::time::sleep(Duration::from_secs(UPDATE_INTERVAL_SECS)).await; } }); @@ -56,6 +56,7 @@ pub async fn start_update_loop(ctx: &Context) -> Result<()> { } /// To be fired from the serenity handler when a message was deleted +#[tracing::instrument(level = "debug", skip(ctx))] pub async fn handle_message_delete( ctx: &Context, channel_id: ChannelId, @@ -64,9 +65,7 @@ pub async fn handle_message_delete( let mut affected_messages = Vec::new(); { let listeners = get_listeners_from_context(ctx).await?; - log::trace!("Locking listener from handle_message_delete."); let mut listeners_lock = listeners.lock().await; - log::trace!("Listener locked."); let handle = MessageHandle::new(channel_id, message_id); if let Some(msg) = listeners_lock.get(&handle) { @@ -74,7 +73,6 @@ pub async fn handle_message_delete( listeners_lock.remove(&handle); } } - log::trace!("Listener unlocked"); for msg in affected_messages { let mut msg = msg.lock().await; msg.on_deleted(ctx).await?; @@ -84,6 +82,7 @@ pub async fn handle_message_delete( } /// To be fired from the serenity handler when multiple messages were deleted +#[tracing::instrument(level = "debug", skip(ctx))] pub async fn handle_message_delete_bulk( ctx: &Context, channel_id: ChannelId, @@ -92,9 +91,7 @@ pub async fn handle_message_delete_bulk( let mut affected_messages = Vec::new(); { let listeners = get_listeners_from_context(ctx).await?; - log::trace!("Locking listener from handle_message_delete_bulk."); let mut listeners_lock = listeners.lock().await; - log::trace!("Listener locked."); for message_id in message_ids { let handle = MessageHandle::new(channel_id, *message_id); @@ -104,7 +101,6 @@ pub async fn handle_message_delete_bulk( } } } - log::trace!("Listener unlocked"); for msg in affected_messages { let mut msg = msg.lock().await; msg.on_deleted(ctx).await?; @@ -114,13 +110,12 @@ pub async fn handle_message_delete_bulk( } /// Fired when a reaction was added to a message +#[tracing::instrument(level = "debug", skip(ctx))] pub async fn handle_reaction_add(ctx: &Context, reaction: &Reaction) -> Result<()> { let mut affected_messages = Vec::new(); { let listeners = get_listeners_from_context(ctx).await?; - log::trace!("Locking listener from handle_reaction_add."); let mut listeners_lock = listeners.lock().await; - log::trace!("Listener locked."); let handle = MessageHandle::new(reaction.channel_id, reaction.message_id); @@ -128,7 +123,6 @@ pub async fn handle_reaction_add(ctx: &Context, reaction: &Reaction) -> Result<( affected_messages.push(Arc::clone(&msg)); } } - log::trace!("Listener unlocked"); for msg in affected_messages { let mut msg = msg.lock().await; msg.on_reaction_add(ctx, reaction.clone()).await?; @@ -138,13 +132,12 @@ pub async fn handle_reaction_add(ctx: &Context, reaction: &Reaction) -> Result<( } /// Fired when a reaction was added to a message +#[tracing::instrument(level = "debug", skip(ctx))] pub async fn handle_reaction_remove(ctx: &Context, reaction: &Reaction) -> Result<()> { let mut affected_messages = Vec::new(); { let listeners = get_listeners_from_context(ctx).await?; - log::trace!("Locking listener from handle_reaction_remove."); let mut listeners_lock = listeners.lock().await; - log::trace!("Listener locked."); let handle = MessageHandle::new(reaction.channel_id, reaction.message_id); @@ -152,7 +145,6 @@ pub async fn handle_reaction_remove(ctx: &Context, reaction: &Reaction) -> Resul affected_messages.push(Arc::clone(&msg)); } } - log::trace!("Listener unlocked"); for msg in affected_messages { let mut msg = msg.lock().await; msg.on_reaction_remove(ctx, reaction.clone()).await?; diff --git a/src/events/handler.rs b/src/events/handler.rs index 00907be..40634b2 100644 --- a/src/events/handler.rs +++ b/src/events/handler.rs @@ -49,6 +49,7 @@ pub struct RichEventHandler { impl RichEventHandler { /// Handles a generic event + #[tracing::instrument(level = "debug", skip_all)] async fn handle_event(&self, ctx: Context, value: T) { let callbacks = self.callbacks.clone(); @@ -58,7 +59,7 @@ impl RichEventHandler { for callback in callbacks { if let Some(cb) = callback.downcast_ref::>() { if let Err(e) = cb.run(&ctx, &value).await { - log::error!("Error in event callback: {:?}", e); + tracing::error!("Error in event callback: {:?}", e); } } } diff --git a/src/menu/container.rs b/src/menu/container.rs index bf1957c..9cd473d 100644 --- a/src/menu/container.rs +++ b/src/menu/container.rs @@ -16,11 +16,11 @@ impl TypeMapKey for EventDrivenMessageContainer { type Value = EventDrivenMessagesRef; } +#[tracing::instrument(level = "trace", skip(ctx))] pub async fn get_listeners_from_context(ctx: &Context) -> Result { let data = ctx.data.read().await; let listeners = data .get::() .ok_or(Error::Uninitialized)?; - log::trace!("Returning listener"); Ok(listeners.clone()) } diff --git a/src/menu/controls.rs b/src/menu/controls.rs index 2d36146..84508ea 100644 --- a/src/menu/controls.rs +++ b/src/menu/controls.rs @@ -10,8 +10,8 @@ use serenity::model::channel::Reaction; use std::sync::atomic::Ordering; /// Shows the next page in the menu +#[tracing::instrument(level = "debug", skip_all)] pub async fn next_page(ctx: &Context, menu: &mut Menu<'_>, _: Reaction) -> Result<()> { - log::debug!("Showing next page"); menu.current_page = (menu.current_page + 1) % menu.pages.len(); display_page(ctx, menu).await?; @@ -19,8 +19,8 @@ pub async fn next_page(ctx: &Context, menu: &mut Menu<'_>, _: Reaction) -> Resul } /// Shows the previous page in the menu +#[tracing::instrument(level = "debug", skip_all)] pub async fn previous_page(ctx: &Context, menu: &mut Menu<'_>, _: Reaction) -> Result<()> { - log::debug!("Showing previous page"); if menu.current_page == 0 { menu.current_page = menu.pages.len() - 1; } else { @@ -32,8 +32,8 @@ pub async fn previous_page(ctx: &Context, menu: &mut Menu<'_>, _: Reaction) -> R } /// Shows the previous page in the menu +#[tracing::instrument(level = "debug", skip_all)] pub async fn close_menu(ctx: &Context, menu: &mut Menu<'_>, _: Reaction) -> Result<()> { - log::debug!("Closing menu"); menu.close(ctx.http()).await?; let listeners = get_listeners_from_context(&ctx).await?; let mut listeners_lock = listeners.lock().await; @@ -43,8 +43,9 @@ pub async fn close_menu(ctx: &Context, menu: &mut Menu<'_>, _: Reaction) -> Resu Ok(()) } +/// Shows a help menu +#[tracing::instrument(level = "debug", skip_all)] pub async fn toggle_help(ctx: &Context, menu: &mut Menu<'_>, _: Reaction) -> Result<()> { - log::debug!("Displaying help"); let show_help = menu .data .get::() @@ -63,7 +64,7 @@ pub async fn toggle_help(ctx: &Context, menu: &mut Menu<'_>, _: Reaction) -> Res .get() .await?; let mut message = menu.get_message(ctx.http()).await?; - log::debug!("Building help entries"); + tracing::debug!("Building help entries"); let mut help_entries = menu .help_entries .iter() @@ -75,7 +76,7 @@ pub async fn toggle_help(ctx: &Context, menu: &mut Menu<'_>, _: Reaction) -> Res .map(|(_, e, h)| format!(" - {} {}", e, h)) .collect::>() .join("\n"); - log::trace!("Help message is {}", help_message); + tracing::trace!("Help message is {}", help_message); message .edit(ctx, |m| { @@ -104,15 +105,16 @@ pub async fn toggle_help(ctx: &Context, menu: &mut Menu<'_>, _: Reaction) -> Res m }) .await?; - log::debug!("Help message displayed"); + tracing::debug!("Help message displayed"); show_help.store(true, Ordering::Relaxed); Ok(()) } /// Displays the menu page +#[tracing::instrument(level = "debug", skip_all)] pub async fn display_page(ctx: &Context, menu: &mut Menu<'_>) -> Result<()> { - log::debug!("Displaying page {}", menu.current_page); + tracing::debug!("Displaying page {}", menu.current_page); let page = menu .pages .get(menu.current_page) @@ -126,7 +128,7 @@ pub async fn display_page(ctx: &Context, menu: &mut Menu<'_>) -> Result<()> { e }) .await?; - log::debug!("Page displayed"); + tracing::debug!("Page displayed"); Ok(()) } diff --git a/src/menu/menu.rs b/src/menu/menu.rs index 39af09c..95b468a 100644 --- a/src/menu/menu.rs +++ b/src/menu/menu.rs @@ -81,8 +81,8 @@ pub struct Menu<'a> { impl Menu<'_> { /// Removes all reactions from the menu + #[tracing::instrument(level = "debug", skip_all)] pub(crate) async fn close(&mut self, http: &Http) -> Result<()> { - log::debug!("Closing menu..."); let handle = self.message.read().await; http.delete_message_reactions(handle.channel_id, handle.message_id) .await?; @@ -101,14 +101,12 @@ impl Menu<'_> { } /// Recreates the message completely + #[tracing::instrument(level = "debug", skip_all)] pub async fn recreate(&self, http: &Http) -> Result<()> { - log::debug!("Recreating message"); - let old_handle = { let handle = self.message.read().await; (*handle).clone() }; - log::debug!("Getting current page"); let current_page = self .pages .get(self.current_page) @@ -117,7 +115,6 @@ impl Menu<'_> { .get() .await?; - log::debug!("Creating new message"); let message = http .send_message( old_handle.channel_id, @@ -139,7 +136,6 @@ impl Menu<'_> { ) .await?; } - log::trace!("New message is {:?}", message); let new_handle = { let mut handle = self.message.write().await; @@ -147,15 +143,14 @@ impl Menu<'_> { (*handle).clone() }; { - log::debug!("Changing key of message"); + tracing::debug!("Changing key of message"); let mut listeners_lock = self.listeners.lock().await; let menu = listeners_lock.remove(&old_handle).unwrap(); listeners_lock.insert(new_handle, menu); } - log::debug!("Deleting original message"); + tracing::debug!("Deleting original message"); http.delete_message(old_handle.channel_id, old_handle.message_id) .await?; - log::debug!("Message recreated"); Ok(()) } @@ -167,13 +162,14 @@ impl<'a> EventDrivenMessage for Menu<'a> { self.closed } + #[tracing::instrument(level = "debug", skip_all)] async fn update(&mut self, http: &Http) -> Result<()> { - log::trace!("Checking for menu timeout"); + tracing::trace!("Checking for menu timeout"); if Instant::now() >= self.timeout { - log::debug!("Menu timout reached. Closing menu."); + tracing::debug!("Menu timout reached. Closing menu."); self.close(http).await?; } else if self.sticky { - log::debug!("Message is sticky. Checking for new messages in channel..."); + tracing::debug!("Message is sticky. Checking for new messages in channel..."); let handle = { let handle = self.message.read().await; (*handle).clone() @@ -183,9 +179,8 @@ impl<'a> EventDrivenMessage for Menu<'a> { let messages = channel_id .messages(http, |p| p.after(handle.message_id).limit(1)) .await?; - log::trace!("Messages are {:?}", messages); if messages.len() > 0 { - log::debug!("New messages in channel. Recreating..."); + tracing::debug!("New messages in channel. Recreating..."); self.recreate(http).await?; } } @@ -193,26 +188,28 @@ impl<'a> EventDrivenMessage for Menu<'a> { Ok(()) } + #[tracing::instrument(level = "debug", skip_all)] async fn on_reaction_add(&mut self, ctx: &Context, reaction: Reaction) -> Result<()> { - log::debug!("Reaction to menu added"); let current_user = ctx.http.get_current_user().await?; if reaction.user_id.unwrap().0 == current_user.id.0 { - log::debug!("Reaction is from current user."); + tracing::debug!("Reaction is from current user."); return Ok(()); } let emoji_string = reaction.emoji.as_data(); - log::debug!("Deleting user reaction."); + tracing::debug!("Deleting user reaction."); reaction.delete(ctx).await?; if let Some(owner) = self.owner { if owner != reaction.user_id.unwrap() { - log::debug!("Menu has an owner and the reaction is not from the owner of the menu"); + tracing::debug!( + "Menu has an owner and the reaction is not from the owner of the menu" + ); return Ok(()); } } if let Some(control) = self.controls.get(&emoji_string).cloned() { - log::debug!("Running control"); + tracing::debug!("Running control"); control.run(ctx, self, reaction).await?; } @@ -249,8 +246,8 @@ impl Default for MenuBuilder { impl MenuBuilder { /// Creates a new pagination menu + #[tracing::instrument(level = "debug", skip_all)] pub fn new_paginator() -> Self { - log::debug!("Creating new paginator"); let mut controls = HashMap::new(); let mut help_entries = HashMap::new(); controls.insert( @@ -391,12 +388,12 @@ impl MenuBuilder { } /// builds the menu + #[tracing::instrument(level = "debug", skip_all)] pub async fn build( self, ctx: &Context, channel_id: ChannelId, ) -> Result>> { - log::debug!("Building menu..."); let mut current_page = self .pages .get(self.current_page) @@ -406,9 +403,8 @@ impl MenuBuilder { .await?; let message = channel_id.send_message(ctx, |_| &mut current_page).await?; - log::trace!("Message is {:?}", message); let listeners = get_listeners_from_context(ctx).await?; - log::debug!("Sorting controls..."); + tracing::debug!("Sorting controls..."); let mut controls = self .controls .clone() @@ -416,7 +412,7 @@ impl MenuBuilder { .collect::>(); controls.sort_by_key(|(_, a)| a.position); - log::debug!("Creating menu..."); + tracing::debug!("Creating menu..."); let message_handle = MessageHandle::new(message.channel_id, message.id); let handle_lock = Arc::new(RwLock::new(message_handle)); @@ -434,20 +430,19 @@ impl MenuBuilder { owner: self.owner, }; - log::debug!("Storing menu to listeners..."); + tracing::debug!("Storing menu to listeners..."); { let mut listeners_lock = listeners.lock().await; - log::trace!("Listeners locked."); + tracing::trace!("Listeners locked."); listeners_lock.insert(message_handle, Arc::new(Mutex::new(Box::new(menu)))); } - log::debug!("Adding controls..."); + tracing::debug!("Adding controls..."); for (emoji, _) in controls { message .react(ctx, ReactionType::Unicode(emoji.clone())) .await?; } - log::debug!("Menu successfully created."); Ok(handle_lock) }