Update deps, fixes for axum = "0.7"

This commit is contained in:
Aadi Desai 2023-12-07 00:24:46 +00:00
parent cdde26e940
commit 2217d65201
Signed by: supleed2
SSH key fingerprint: SHA256:CkbNRs0yVzXEiUp2zd0PSxsfRUMFF9bLlKXtE1xEbKM
3 changed files with 211 additions and 60 deletions

253
Cargo.lock generated
View file

@ -153,13 +153,44 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "3b829e4e32b91e643de6eafe82b1d90675f5874230191a4ffbc1b336dec4d6bf" checksum = "3b829e4e32b91e643de6eafe82b1d90675f5874230191a4ffbc1b336dec4d6bf"
dependencies = [ dependencies = [
"async-trait", "async-trait",
"axum-core", "axum-core 0.3.4",
"bitflags 1.3.2", "bitflags 1.3.2",
"bytes", "bytes",
"futures-util", "futures-util",
"http", "http 0.2.10",
"http-body", "http-body 0.4.5",
"hyper", "hyper 0.14.27",
"itoa",
"matchit",
"memchr",
"mime",
"percent-encoding",
"pin-project-lite",
"rustversion",
"serde",
"serde_json",
"serde_path_to_error",
"sync_wrapper",
"tower",
"tower-layer",
"tower-service",
]
[[package]]
name = "axum"
version = "0.7.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "202651474fe73c62d9e0a56c6133f7a0ff1dc1c8cf7a5b03381af2a26553ac9d"
dependencies = [
"async-trait",
"axum-core 0.4.1",
"bytes",
"futures-util",
"http 1.0.0",
"http-body 1.0.0",
"http-body-util",
"hyper 1.0.1",
"hyper-util",
"itoa", "itoa",
"matchit", "matchit",
"memchr", "memchr",
@ -187,14 +218,34 @@ dependencies = [
"async-trait", "async-trait",
"bytes", "bytes",
"futures-util", "futures-util",
"http", "http 0.2.10",
"http-body", "http-body 0.4.5",
"mime", "mime",
"rustversion", "rustversion",
"tower-layer", "tower-layer",
"tower-service", "tower-service",
] ]
[[package]]
name = "axum-core"
version = "0.4.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "77cb22c689c44d4c07b0ab44ebc25d69d8ae601a2f28fb8d672d344178fa17aa"
dependencies = [
"async-trait",
"bytes",
"futures-util",
"http 1.0.0",
"http-body 1.0.0",
"http-body-util",
"mime",
"pin-project-lite",
"rustversion",
"sync_wrapper",
"tower-layer",
"tower-service",
]
[[package]] [[package]]
name = "backtrace" name = "backtrace"
version = "0.3.69" version = "0.3.69"
@ -807,7 +858,7 @@ dependencies = [
"futures-core", "futures-core",
"futures-sink", "futures-sink",
"futures-util", "futures-util",
"http", "http 0.2.10",
"indexmap 1.9.3", "indexmap 1.9.3",
"slab", "slab",
"tokio", "tokio",
@ -815,6 +866,25 @@ dependencies = [
"tracing", "tracing",
] ]
[[package]]
name = "h2"
version = "0.4.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "e1d308f63daf4181410c242d34c11f928dcb3aa105852019e043c9d1f4e4368a"
dependencies = [
"bytes",
"fnv",
"futures-core",
"futures-sink",
"futures-util",
"http 1.0.0",
"indexmap 2.1.0",
"slab",
"tokio",
"tokio-util",
"tracing",
]
[[package]] [[package]]
name = "hashbrown" name = "hashbrown"
version = "0.12.3" version = "0.12.3"
@ -849,7 +919,7 @@ dependencies = [
"base64 0.21.5", "base64 0.21.5",
"bytes", "bytes",
"headers-core", "headers-core",
"http", "http 0.2.10",
"httpdate", "httpdate",
"mime", "mime",
"sha1", "sha1",
@ -861,7 +931,7 @@ version = "0.2.0"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "e7f66481bfee273957b1f20485a4ff3362987f85b2c236580d81b4eb7a326429" checksum = "e7f66481bfee273957b1f20485a4ff3362987f85b2c236580d81b4eb7a326429"
dependencies = [ dependencies = [
"http", "http 0.2.10",
] ]
[[package]] [[package]]
@ -923,6 +993,17 @@ dependencies = [
"itoa", "itoa",
] ]
[[package]]
name = "http"
version = "1.0.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "b32afd38673a8016f7c9ae69e5af41a58f81b1d31689040f2f1959594ce194ea"
dependencies = [
"bytes",
"fnv",
"itoa",
]
[[package]] [[package]]
name = "http-body" name = "http-body"
version = "0.4.5" version = "0.4.5"
@ -930,7 +1011,30 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "d5f38f16d184e36f2408a55281cd658ecbd3ca05cce6d6510a176eca393e26d1" checksum = "d5f38f16d184e36f2408a55281cd658ecbd3ca05cce6d6510a176eca393e26d1"
dependencies = [ dependencies = [
"bytes", "bytes",
"http", "http 0.2.10",
"pin-project-lite",
]
[[package]]
name = "http-body"
version = "1.0.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "1cac85db508abc24a2e48553ba12a996e87244a0395ce011e62b37158745d643"
dependencies = [
"bytes",
"http 1.0.0",
]
[[package]]
name = "http-body-util"
version = "0.1.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "41cb79eb393015dadd30fc252023adb0b2400a0caee0fa2a077e6e21a551e840"
dependencies = [
"bytes",
"futures-util",
"http 1.0.0",
"http-body 1.0.0",
"pin-project-lite", "pin-project-lite",
] ]
@ -962,9 +1066,9 @@ dependencies = [
"futures-channel", "futures-channel",
"futures-core", "futures-core",
"futures-util", "futures-util",
"h2", "h2 0.3.21",
"http", "http 0.2.10",
"http-body", "http-body 0.4.5",
"httparse", "httparse",
"httpdate", "httpdate",
"itoa", "itoa",
@ -976,6 +1080,25 @@ dependencies = [
"want", "want",
] ]
[[package]]
name = "hyper"
version = "1.0.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "403f9214f3e703236b221f1a9cd88ec8b4adfa5296de01ab96216361f4692f56"
dependencies = [
"bytes",
"futures-channel",
"futures-util",
"h2 0.4.0",
"http 1.0.0",
"http-body 1.0.0",
"httparse",
"httpdate",
"itoa",
"pin-project-lite",
"tokio",
]
[[package]] [[package]]
name = "hyper-rustls" name = "hyper-rustls"
version = "0.24.2" version = "0.24.2"
@ -983,8 +1106,8 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "ec3efd23720e2049821a693cbc7e65ea87c72f1c58ff2f9522ff332b1491e590" checksum = "ec3efd23720e2049821a693cbc7e65ea87c72f1c58ff2f9522ff332b1491e590"
dependencies = [ dependencies = [
"futures-util", "futures-util",
"http", "http 0.2.10",
"hyper", "hyper 0.14.27",
"rustls 0.21.8", "rustls 0.21.8",
"tokio", "tokio",
"tokio-rustls 0.24.1", "tokio-rustls 0.24.1",
@ -996,7 +1119,7 @@ version = "0.4.1"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "bbb958482e8c7be4bc3cf272a766a2b0bf1a6755e7a6ae777f017a31d11b13b1" checksum = "bbb958482e8c7be4bc3cf272a766a2b0bf1a6755e7a6ae777f017a31d11b13b1"
dependencies = [ dependencies = [
"hyper", "hyper 0.14.27",
"pin-project-lite", "pin-project-lite",
"tokio", "tokio",
"tokio-io-timeout", "tokio-io-timeout",
@ -1009,12 +1132,32 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "d6183ddfa99b85da61a140bea0efc93fdf56ceaa041b37d553518030827f9905" checksum = "d6183ddfa99b85da61a140bea0efc93fdf56ceaa041b37d553518030827f9905"
dependencies = [ dependencies = [
"bytes", "bytes",
"hyper", "hyper 0.14.27",
"native-tls", "native-tls",
"tokio", "tokio",
"tokio-native-tls", "tokio-native-tls",
] ]
[[package]]
name = "hyper-util"
version = "0.1.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "9ca339002caeb0d159cc6e023dff48e199f081e42fa039895c7c6f38b37f2e9d"
dependencies = [
"bytes",
"futures-channel",
"futures-util",
"http 1.0.0",
"http-body 1.0.0",
"hyper 1.0.1",
"pin-project-lite",
"socket2 0.5.5",
"tokio",
"tower",
"tower-service",
"tracing",
]
[[package]] [[package]]
name = "iana-time-zone" name = "iana-time-zone"
version = "0.1.58" version = "0.1.58"
@ -1281,7 +1424,7 @@ name = "nano"
version = "0.1.0" version = "0.1.0"
dependencies = [ dependencies = [
"anyhow", "anyhow",
"axum", "axum 0.7.2",
"indoc", "indoc",
"poise", "poise",
"reqwest", "reqwest",
@ -1499,7 +1642,7 @@ checksum = "7f51189ce8be654f9b5f7e70e49967ed894e84a06fc35c6c042e64ac1fc5399e"
dependencies = [ dependencies = [
"async-trait", "async-trait",
"bytes", "bytes",
"http", "http 0.2.10",
"opentelemetry", "opentelemetry",
] ]
@ -1511,7 +1654,7 @@ checksum = "f24cda83b20ed2433c68241f918d0f6fdec8b1d43b7a9590ab4420c5095ca930"
dependencies = [ dependencies = [
"async-trait", "async-trait",
"futures-core", "futures-core",
"http", "http 0.2.10",
"opentelemetry", "opentelemetry",
"opentelemetry-proto", "opentelemetry-proto",
"opentelemetry-semantic-conventions", "opentelemetry-semantic-conventions",
@ -1936,10 +2079,10 @@ dependencies = [
"encoding_rs", "encoding_rs",
"futures-core", "futures-core",
"futures-util", "futures-util",
"h2", "h2 0.3.21",
"http", "http 0.2.10",
"http-body", "http-body 0.4.5",
"hyper", "hyper 0.14.27",
"hyper-rustls", "hyper-rustls",
"hyper-tls", "hyper-tls",
"ipnet", "ipnet",
@ -2323,9 +2466,9 @@ dependencies = [
[[package]] [[package]]
name = "shuttle-codegen" name = "shuttle-codegen"
version = "0.34.0" version = "0.34.1"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "36d3815ee807c2563cc185c816284ddc21c9b85dbbad4adb96a6fbfcce6d35b6" checksum = "99f584e6f02d513abb864d5a33fb24531318080385eeac6160a9ccf2988b31bb"
dependencies = [ dependencies = [
"proc-macro-error", "proc-macro-error",
"proc-macro2", "proc-macro2",
@ -2335,21 +2478,21 @@ dependencies = [
[[package]] [[package]]
name = "shuttle-common" name = "shuttle-common"
version = "0.34.0" version = "0.34.1"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "9264106f4bff88034fe57655a9e1bbd8ab5de91d6796f3c95197ef9ab81bcb48" checksum = "d0406c689a1edb0d12bd813d2b245619752ce0ad6122dad35c3f08ffccd2a40c"
dependencies = [ dependencies = [
"anyhow", "anyhow",
"async-trait", "async-trait",
"axum", "axum 0.6.20",
"bytes", "bytes",
"chrono", "chrono",
"comfy-table", "comfy-table",
"crossterm 0.27.0", "crossterm 0.27.0",
"headers", "headers",
"http", "http 0.2.10",
"http-body", "http-body 0.4.5",
"hyper", "hyper 0.14.27",
"jsonwebtoken", "jsonwebtoken",
"opentelemetry", "opentelemetry",
"opentelemetry-http", "opentelemetry-http",
@ -2377,9 +2520,9 @@ dependencies = [
[[package]] [[package]]
name = "shuttle-proto" name = "shuttle-proto"
version = "0.34.0" version = "0.34.1"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "48c8e18375ee467da38bdbb8bd23f0f267f1f33ae16c3ac6659a257ca3ba96c7" checksum = "aa63942eb5dfbc6370a82611f40254b9af28f323985d3c01be400baf729c1104"
dependencies = [ dependencies = [
"futures-core", "futures-core",
"prost 0.12.1", "prost 0.12.1",
@ -2390,9 +2533,9 @@ dependencies = [
[[package]] [[package]]
name = "shuttle-runtime" name = "shuttle-runtime"
version = "0.34.0" version = "0.34.1"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "b492f7eead3049dcb1afc64aee03bbb8bb455ebf6e753e93d61e34d8c723dc69" checksum = "4b8c49e755478841ae03351c3a4e7af99c684ce9757e5ddb0071d1ac42d33937"
dependencies = [ dependencies = [
"anyhow", "anyhow",
"async-trait", "async-trait",
@ -2414,9 +2557,9 @@ dependencies = [
[[package]] [[package]]
name = "shuttle-secrets" name = "shuttle-secrets"
version = "0.34.0" version = "0.34.1"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "eb1a2e7a65c3b830e28e7fb9885d265455bf90ca3b419aa66b1d875e9fe42ee3" checksum = "f0e0269b915526626e515996f77f68b433defc3be35221da87ed3eea4dce25a4"
dependencies = [ dependencies = [
"async-trait", "async-trait",
"secrecy", "secrecy",
@ -2426,9 +2569,9 @@ dependencies = [
[[package]] [[package]]
name = "shuttle-service" name = "shuttle-service"
version = "0.34.0" version = "0.34.1"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "2cf8dc69c29252cbd7052d49682adfd47b82530c226a3c7e884b34bf9244feac" checksum = "b1c89dbd86fb79a791587317252daac5aa5026ed6fd73ce9f458acd30245bb13"
dependencies = [ dependencies = [
"anyhow", "anyhow",
"async-trait", "async-trait",
@ -2440,9 +2583,9 @@ dependencies = [
[[package]] [[package]]
name = "shuttle-shared-db" name = "shuttle-shared-db"
version = "0.34.0" version = "0.34.1"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "703ebe15d531899a24ee3e4a84e969a43eb0f6c443aacfaba75c5e124bc53606" checksum = "3af86eba0a3ed1db8a91015da1a7f08e4d22450d67e2b980c804da7827a22378"
dependencies = [ dependencies = [
"async-trait", "async-trait",
"serde", "serde",
@ -3080,15 +3223,15 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "3082666a3a6433f7f511c7192923fa1fe07c69332d3c6a2e6bb040b569199d5a" checksum = "3082666a3a6433f7f511c7192923fa1fe07c69332d3c6a2e6bb040b569199d5a"
dependencies = [ dependencies = [
"async-trait", "async-trait",
"axum", "axum 0.6.20",
"base64 0.21.5", "base64 0.21.5",
"bytes", "bytes",
"futures-core", "futures-core",
"futures-util", "futures-util",
"h2", "h2 0.3.21",
"http", "http 0.2.10",
"http-body", "http-body 0.4.5",
"hyper", "hyper 0.14.27",
"hyper-timeout", "hyper-timeout",
"percent-encoding", "percent-encoding",
"pin-project", "pin-project",
@ -3109,13 +3252,13 @@ checksum = "d560933a0de61cf715926b9cac824d4c883c2c43142f787595e48280c40a1d0e"
dependencies = [ dependencies = [
"async-stream", "async-stream",
"async-trait", "async-trait",
"axum", "axum 0.6.20",
"base64 0.21.5", "base64 0.21.5",
"bytes", "bytes",
"h2", "h2 0.3.21",
"http", "http 0.2.10",
"http-body", "http-body 0.4.5",
"hyper", "hyper 0.14.27",
"hyper-timeout", "hyper-timeout",
"percent-encoding", "percent-encoding",
"pin-project", "pin-project",
@ -3158,8 +3301,8 @@ dependencies = [
"bytes", "bytes",
"futures-core", "futures-core",
"futures-util", "futures-util",
"http", "http 0.2.10",
"http-body", "http-body 0.4.5",
"http-range-header", "http-range-header",
"pin-project-lite", "pin-project-lite",
"tower-layer", "tower-layer",
@ -3284,7 +3427,7 @@ dependencies = [
"base64 0.13.1", "base64 0.13.1",
"byteorder", "byteorder",
"bytes", "bytes",
"http", "http 0.2.10",
"httparse", "httparse",
"log", "log",
"rand", "rand",

View file

@ -12,14 +12,14 @@ publish = false
[dependencies] [dependencies]
anyhow = "1.0.75" anyhow = "1.0.75"
axum = "0.6.20" axum = "0.7.2"
indoc = "2.0.4" indoc = "2.0.4"
poise = "0.5.7" poise = "0.5.7"
reqwest = { version = "0.11.22", features = ["json"] } reqwest = { version = "0.11.22", features = ["json"] }
serde = { version = "1.0.193", features = ["derive"] } serde = { version = "1.0.193", features = ["derive"] }
shuttle-runtime = { version = "0.34.0", default-features = false } shuttle-runtime = { version = "0.34.1", default-features = false }
shuttle-secrets = "0.34.0" shuttle-secrets = "0.34.1"
shuttle-shared-db = { version = "0.34.0", features = ["postgres"] } shuttle-shared-db = { version = "0.34.1", features = ["postgres"] }
sqlx = { version = "0.7.3", features = [ sqlx = { version = "0.7.3", features = [
"macros", "macros",
"postgres", "postgres",

View file

@ -8,7 +8,15 @@ pub(crate) struct NanoBot {
#[shuttle_runtime::async_trait] #[shuttle_runtime::async_trait]
impl shuttle_runtime::Service for NanoBot { impl shuttle_runtime::Service for NanoBot {
async fn bind(mut self, addr: std::net::SocketAddr) -> Result<(), shuttle_runtime::Error> { async fn bind(mut self, addr: std::net::SocketAddr) -> Result<(), shuttle_runtime::Error> {
let serve = axum::Server::bind(&addr).serve(self.router.into_make_service()); use std::future::IntoFuture;
let serve = axum::serve(
shuttle_runtime::tokio::net::TcpListener::bind(addr)
.await
.map_err(shuttle_runtime::CustomError::new)?,
self.router,
)
.into_future();
tokio::select! { tokio::select! {
_ = self.discord.run_autosharded() => {}, _ = self.discord.run_autosharded() => {},