Skip to content
This repository was archived by the owner on Jun 17, 2025. It is now read-only.

Commit e379c71

Browse files
committed
Fix some clippy lints
1 parent 4c54c81 commit e379c71

File tree

11 files changed

+14
-39
lines changed

11 files changed

+14
-39
lines changed

scripty_audio_handler/src/connect.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -207,14 +207,14 @@ pub async fn connect_to_vc(
207207
call_connection_attempt_fut.await?;
208208

209209
debug!(%guild_id, "placing info into redis");
210-
scripty_redis::run_transaction("SET", |f| {
210+
scripty_redis::run_transaction::<()>("SET", |f| {
211211
f.arg(format!("voice:{{{}}}:webhook_token", guild_id))
212212
.arg(webhook_token.expose_secret())
213213
.arg("EX")
214214
.arg(leave_delta + 5);
215215
})
216216
.await?;
217-
scripty_redis::run_transaction("SET", |f| {
217+
scripty_redis::run_transaction::<()>("SET", |f| {
218218
f.arg(format!("voice:{{{}}}:webhook_id", guild_id))
219219
.arg(webhook_id.get())
220220
.arg("EX")

scripty_bot/src/framework_opts.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
use std::{borrow::Cow, sync::Arc, time::Duration};
1+
use std::{sync::Arc, time::Duration};
22

33
use poise::{EditTracker, FrameworkOptions, PrefixFrameworkOptions};
44
use scripty_bot_utils::{

scripty_bot_utils/src/entity_block.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ pub async fn init_blocked() -> Result<(), scripty_redis::redis::RedisError> {
3131
}
3232
blocked_user_pipe
3333
.ignore()
34-
.query_async(&mut redis_pool)
34+
.query_async::<_, ()>(&mut redis_pool)
3535
.await?;
3636
}
3737

@@ -52,7 +52,7 @@ pub async fn init_blocked() -> Result<(), scripty_redis::redis::RedisError> {
5252

5353
blocked_guild_pipe
5454
.ignore()
55-
.query_async(&mut redis_pool)
55+
.query_async::<_, ()>(&mut redis_pool)
5656
.await?;
5757
}
5858

@@ -152,7 +152,7 @@ pub async fn add_blocked_user(user_id: UserId, reason: Option<String>) -> Result
152152
.await?;
153153

154154
redis
155-
.set(
155+
.set::<_, _, ()>(
156156
format!(
157157
"user:{{{}}}:blocked",
158158
scripty_utils::vec_to_hex(&hashed_user_id)
@@ -182,7 +182,7 @@ pub async fn add_blocked_guild(guild_id: GuildId, reason: Option<String>) -> Res
182182
.await?;
183183

184184
redis
185-
.set(
185+
.set::<_, _, ()>(
186186
format!("guild:{{{}}}:blocked", guild_id),
187187
reason.unwrap_or_default(),
188188
)

scripty_bot_utils/src/error/handler.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ async fn _on_error(error: FrameworkError<'_, Data, Error>) {
6060
ErrorEnum::Serenity(serenity::Error::Http(
6161
http::HttpError::UnsuccessfulRequest(http::ErrorResponse {
6262
status_code,
63-
error: DiscordJsonError { code, message, .. },
63+
error: DiscordJsonError { .. },
6464
..
6565
}),
6666
)) if status_code == http::StatusCode::BAD_GATEWAY => {

scripty_bot_utils/src/prefix_handling.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ async fn _dynamic_prefix(
4646
})
4747
.unwrap_or_else(|| scripty_config::get_config().prefix.to_owned());
4848

49-
scripty_redis::run_transaction("SETEX", |cmd| {
49+
scripty_redis::run_transaction::<()>("SETEX", |cmd| {
5050
cmd.arg(format!("prefix_{{{}}}", guild_id.get()))
5151
.arg(60 * 15)
5252
.arg(&maybe_prefix);

scripty_botlists/src/lists/discord_bots_gg/models.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ pub struct PostStats {
66
}
77

88
#[derive(Deserialize, Debug, Clone)]
9+
#[allow(dead_code)]
910
pub struct PostStatsResponse {
1011
pub code: u16,
1112
pub message: String,

scripty_botlists/src/lists/discordextremelist_xyz/models.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ pub struct PostStats {
66
}
77

88
#[derive(Deserialize, Debug, Clone)]
9+
#[allow(dead_code)]
910
pub struct PostStatsResponse {
1011
pub error: bool,
1112
pub status: u16,

scripty_botlists/src/lists/disforge_com/models.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ pub struct PostStats {
44
}
55

66
#[derive(Deserialize, Debug, Clone)]
7+
#[allow(dead_code)]
78
pub struct PostStatsResponse {
89
pub status: String,
910
pub message: String,

scripty_data_storage/src/cache/voice.rs

Lines changed: 0 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -1,32 +1,3 @@
1-
/// Pre-populate the cache with voice state data.
2-
pub async fn init_voice_cache_async() -> Result<(), scripty_redis::redis::RedisError> {
3-
let mut pipe = scripty_redis::redis::pipe();
4-
5-
// users is a Vec<adhoc struct>
6-
// each adhoc struct has a user_id and a store_audio field
7-
let users = sqlx::query!("SELECT user_id, store_audio FROM users")
8-
.fetch_all(scripty_db::get_db())
9-
.await
10-
.expect("failed to run sql query");
11-
12-
for user in users {
13-
pipe.set(
14-
format!("user:{{{}}}:store_audio", hex::encode(user.user_id)),
15-
user.store_audio,
16-
);
17-
}
18-
pipe.ignore()
19-
.query_async(
20-
&mut scripty_redis::get_pool()
21-
.get()
22-
.await
23-
.expect("failed to fetch pool"),
24-
)
25-
.await?;
26-
27-
Ok(())
28-
}
29-
301
/// Change a user's voice storage state
312
///
323
/// # Returns

scripty_premium/src/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
use std::{borrow::Cow, fmt, num::NonZeroU64};
1+
use std::{borrow::Cow, fmt};
22

33
use time::OffsetDateTime;
44

0 commit comments

Comments
 (0)