bump dependencies and clippy fixes

This commit is contained in:
boring_nick 2023-08-30 22:37:48 +03:00
parent 8f382b508a
commit 0b0e45fe96
4 changed files with 356 additions and 386 deletions

678
Cargo.lock generated

File diff suppressed because it is too large Load Diff

View File

@ -5,36 +5,36 @@ edition = "2021"
[dependencies] [dependencies]
aide = { version = "0.11.0", features = ["axum", "redoc"] } aide = { version = "0.11.0", features = ["axum", "redoc"] }
anyhow = "1.0.71" anyhow = "1.0.75"
axum = { version = "0.6.18", features = ["headers"] } axum = { version = "0.6.20", features = ["headers"] }
chrono = { version = "0.4.26", features = ["serde"] } chrono = { version = "0.4.27", features = ["serde"] }
clap = { version = "4.3.4", features = ["derive"] } clap = { version = "4.4.1", features = ["derive"] }
clickhouse = { version = "0.11.5", default-features = false, features = [ clickhouse = { version = "0.11.5", default-features = false, features = [
"lz4", "lz4",
] } ] }
dashmap = { version = "5.4.0", features = ["serde"] } dashmap = { version = "5.5.3", features = ["serde"] }
flate2 = "1.0.26" flate2 = "1.0.27"
futures = "0.3.28" futures = "0.3.28"
indexmap = "1.9.3" indexmap = "1.9.3"
lazy_static = "1.4.0" lazy_static = "1.4.0"
mimalloc = { version = "0.1.37", default-features = false } mimalloc = { version = "0.1.38", default-features = false }
mime_guess = "2.0.4" mime_guess = "2.0.4"
prometheus = "0.13.3" prometheus = "0.13.3"
rand = "0.8.5" rand = "0.8.5"
rayon = "1.7.0" rayon = "1.7.0"
reqwest = { version = "0.11.18", features = [ reqwest = { version = "0.11.20", features = [
"rustls-tls", "rustls-tls",
], default-features = false } ], default-features = false }
rust-embed = { version = "6.7.0", features = ["interpolate-folder-path"] } rust-embed = { version = "8.0.0", features = ["interpolate-folder-path"] }
schemars = "0.8.12" schemars = "0.8.13"
serde = { version = "1.0.164", features = ["derive"] } serde = { version = "1.0.188", features = ["derive"] }
serde_json = { version = "1.0.97", features = ["preserve_order"] } serde_json = { version = "1.0.105", features = ["preserve_order"] }
serde_repr = "0.1.12" serde_repr = "0.1.16"
strum = { version = "0.25.0", features = ["derive"] } strum = { version = "0.25.0", features = ["derive"] }
thiserror = "1.0.40" thiserror = "1.0.47"
tokio = { version = "1.28.2", features = ["sync", "signal", "rt-multi-thread"] } tokio = { version = "1.32.0", features = ["sync", "signal", "rt-multi-thread"] }
tokio-stream = "0.1.14" tokio-stream = "0.1.14"
tower-http = { version = "0.4.0", features = [ tower-http = { version = "0.4.3", features = [
"trace", "trace",
"cors", "cors",
"normalize-path", "normalize-path",
@ -42,7 +42,7 @@ tower-http = { version = "0.4.0", features = [
] } ] }
tracing = "0.1.37" tracing = "0.1.37"
tracing-subscriber = { version = "0.3.17", features = ["env-filter"] } tracing-subscriber = { version = "0.3.17", features = ["env-filter"] }
twitch-irc = { version = "5.0.0", default-features = false, features = [ twitch-irc = { version = "5.0.1", default-features = false, features = [
"metrics-collection", "metrics-collection",
"transport-tcp-rustls-webpki-roots", "transport-tcp-rustls-webpki-roots",
] } ] }
@ -52,9 +52,9 @@ twitch_api2 = { version = "0.6.1", features = [
"twitch_oauth2", "twitch_oauth2",
] } ] }
twitch = { git = "https://github.com/jprochazk/twitch-rs", features = ["simd"] } twitch = { git = "https://github.com/jprochazk/twitch-rs", features = ["simd"] }
axum-prometheus = "0.3.3" axum-prometheus = "0.4.0"
metrics-prometheus = "0.4.1" metrics-prometheus = "0.4.1"
async-trait = "0.1.68" async-trait = "0.1.73"
[dev-dependencies] [dev-dependencies]
pretty_assertions = "1.3.0" pretty_assertions = "1.4.0"

View File

@ -261,17 +261,15 @@ impl Bot {
if self.app.optout_codes.remove(*arg).is_some() { if self.app.optout_codes.remove(*arg).is_some() {
self.app.optout_user(sender_id).await?; self.app.optout_user(sender_id).await?;
Ok(())
} else if self.check_admin(sender_login).is_ok() {
let user_id = self.app.get_user_id_by_name(arg).await?;
self.app.optout_user(&user_id).await?;
Ok(()) Ok(())
} else { } else {
if self.check_admin(sender_login).is_ok() { Err(anyhow!("Invalid optout code"))
let user_id = self.app.get_user_id_by_name(arg).await?;
self.app.optout_user(&user_id).await?;
Ok(())
} else {
Err(anyhow!("Invalid optout code"))
}
} }
} }

View File

@ -116,9 +116,9 @@ async fn get_channel_logs_inner(
channel_id: &str, channel_id: &str,
channel_log_params: LogRangeParams, channel_log_params: LogRangeParams,
) -> Result<impl IntoApiResponse> { ) -> Result<impl IntoApiResponse> {
app.check_opted_out(&channel_id, None)?; app.check_opted_out(channel_id, None)?;
let stream = read_channel(&app.db, &channel_id, &channel_log_params).await?; let stream = read_channel(&app.db, channel_id, &channel_log_params).await?;
let logs = LogsResponse { let logs = LogsResponse {
response_type: channel_log_params.logs_params.response_type(), response_type: channel_log_params.logs_params.response_type(),
@ -251,9 +251,9 @@ async fn get_user_logs_inner(
user_id: &str, user_id: &str,
log_params: LogRangeParams, log_params: LogRangeParams,
) -> Result<impl IntoApiResponse> { ) -> Result<impl IntoApiResponse> {
app.check_opted_out(&channel_id, Some(&user_id))?; app.check_opted_out(channel_id, Some(user_id))?;
let stream = read_user(&app.db, &channel_id, &user_id, &log_params).await?; let stream = read_user(&app.db, channel_id, user_id, &log_params).await?;
let logs = LogsResponse { let logs = LogsResponse {
stream, stream,