Skip to content

Commit d58552b

Browse files
authored
feat: bump msrv to 1.89, resolve clippy lints (#105)
* chore: update flake.lock * chore: update Cargo.lock, bump cargo dependencies * feat: bump msrv to 1.89 * refactor: resolve clippy 1.89 lints
1 parent ca7db06 commit d58552b

File tree

21 files changed

+124
-181
lines changed

21 files changed

+124
-181
lines changed

Cargo.lock

Lines changed: 80 additions & 70 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ readme = "README.md"
77
description = "A featureful, self-hostable Discord music bot."
88
version = "0.9.2"
99
edition = "2024"
10-
rust-version = "1.88" # when bumping, bump in `Dockerfile` too.
10+
rust-version = "1.89" # when bumping, bump in `Dockerfile` too.
1111
license = "GPL-3.0"
1212
repository = "https://github.com/lyra-music/lyra"
1313
authors = ["fdnt7"]
@@ -29,7 +29,7 @@ itertools = "0.14.0"
2929
regex = "1.11.1"
3030
serde = "1.0.219"
3131
rayon = "1.10.0"
32-
const-str = "0.6.3"
32+
const-str = "0.6.4"
3333

3434
[profile.release]
3535
lto = true

Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
FROM lukemathwalker/cargo-chef:latest-rust-1.88-bookworm AS chef
1+
FROM lukemathwalker/cargo-chef:latest-rust-1.89-bookworm AS chef
22
WORKDIR /app
33

44
# The generated recipe.json should only change if the dependencies changed

flake.lock

Lines changed: 6 additions & 6 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

lyra/Cargo.toml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -28,25 +28,25 @@ serde.workspace = true
2828
rayon.workspace = true
2929
const-str.workspace = true
3030
paste = "1.0.15"
31-
const_panic = { version = "0.2.12", features = ["derive"] }
31+
const_panic = { version = "0.2.13", features = ["derive"] }
3232
dotenvy = "0.15.7"
3333
dotenvy_macro = "0.15.7"
3434
thiserror = "2.0.12"
3535
color-eyre = "0.6.5"
3636
futures = "0.3.31"
37-
tokio = { version = "1.46.1", features = [
37+
tokio = { version = "1.47.1", features = [
3838
"sync",
3939
"signal",
4040
"rt-multi-thread",
4141
"macros",
4242
] }
43-
serde_json = "1.0.140"
43+
serde_json = "1.0.142"
4444
linkify = "0.10.0"
4545
fuzzy-matcher = "0.3.7"
4646
log = "0.4.27"
4747
tracing = "0.1.41"
4848
tracing-subscriber = { version = "0.3.19", features = ["env-filter"] }
49-
rand = "0.9.1"
49+
rand = "0.9.2"
5050
sqlx = { version = "0.8.6", features = [
5151
"postgres",
5252
"runtime-tokio",
@@ -89,5 +89,5 @@ reqwest = { version = "0.12.22", default-features = false, features = [
8989
"charset",
9090
"rustls-tls-native-roots",
9191
] }
92-
rustls = "0.23.29"
92+
rustls = "0.23.31"
9393
derive_builder = "0.20.2"

lyra/src/command/check.rs

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -186,11 +186,14 @@ pub fn noone_else_in(
186186
Ok(())
187187
}
188188

189-
pub struct PollStarter(PollStarterInfo);
189+
pub struct PollStarter(#[expect(unused)] PollStarterInfo);
190190

191191
pub struct PollStarterInfo {
192+
#[expect(unused)]
192193
topic: PollTopic,
194+
#[expect(unused)]
193195
error: PollResolvableError,
196+
#[expect(unused)]
194197
in_voice: PartialInVoice,
195198
}
196199

@@ -318,10 +321,10 @@ pub fn track_is_users(
318321
in_voice_with_user: InVoiceWithUserResult,
319322
) -> Result<(), check::UsersTrackError> {
320323
let author_id = in_voice_with_user.in_voice.author_id;
321-
if let Err(user_only_in) = in_voice_with_user.only() {
322-
if track.requester() != author_id {
323-
return Err(impl_users_track(track, position, user_only_in));
324-
}
324+
if let Err(user_only_in) = in_voice_with_user.only()
325+
&& track.requester() != author_id
326+
{
327+
return Err(impl_users_track(track, position, user_only_in));
325328
}
326329

327330
Ok(())
@@ -726,6 +729,7 @@ pub fn all_users_track(
726729
// }
727730
//
728731

732+
#[expect(unused)]
729733
async fn handle_poll(
730734
error: check::PollResolvableError,
731735
topic: &PollTopic,

lyra/src/command/model/ctx/mod.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -192,7 +192,7 @@ impl<T: CtxKind> Ctx<T, GuildMarker> {
192192
}
193193
}
194194

195-
pub fn bot_member(&self) -> CacheResult<CachedBotMember> {
195+
pub fn bot_member(&'_ self) -> CacheResult<CachedBotMember<'_>> {
196196
self.cache()
197197
.member(self.guild_id(), self.bot().user_id())
198198
.ok_or(Cache)
@@ -238,7 +238,7 @@ impl<T: CtxKind> Ctx<T, GuildMarker> {
238238
)
239239
}
240240

241-
pub fn current_voice_state(&self) -> Option<CachedVoiceStateRef> {
241+
pub fn current_voice_state(&'_ self) -> Option<CachedVoiceStateRef<'_>> {
242242
let user = self.bot().user_id();
243243
self.cache().voice_state(user, self.guild_id())
244244
}

lyra/src/command/require.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -189,7 +189,7 @@ impl GuildIdAware for PartialInVoice {
189189
}
190190
}
191191

192-
pub fn in_voice<T: CtxKind>(ctx: &GuildCtx<T>) -> Result<InVoice, NotInVoice> {
192+
pub fn in_voice<T: CtxKind>(ctx: &'_ GuildCtx<T>) -> Result<InVoice<'_>, NotInVoice> {
193193
Ok(InVoice::new(
194194
ctx.current_voice_state().ok_or(NotInVoice)?.into(),
195195
ctx,
@@ -312,7 +312,7 @@ where
312312
Ok(queue)
313313
}
314314

315-
pub fn current_track(queue: &Queue) -> Result<CurrentTrack, NotPlaying> {
315+
pub fn current_track(queue: &'_ Queue) -> Result<CurrentTrack<'_>, NotPlaying> {
316316
let (current, position) = queue.current_and_position();
317317
Ok(CurrentTrack {
318318
track: current.ok_or(NotPlaying)?,

lyra/src/component/tuning/mod.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,8 @@ use crate::{
2626

2727
#[inline]
2828
fn require_in_voice_unsuppressed_and_player(
29-
ctx: &GuildCtx<impl CtxKind>,
30-
) -> Result<(InVoice, PlayerInterface), RequireInVoiceUnsuppressedAndPlayerError> {
29+
ctx: &'_ GuildCtx<impl CtxKind>,
30+
) -> Result<(InVoice<'_>, PlayerInterface), RequireInVoiceUnsuppressedAndPlayerError> {
3131
let in_voice = require::in_voice(ctx)?.and_unsuppressed()?;
3232
let player = require::player(ctx)?;
3333

lyra/src/core/model/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -300,7 +300,7 @@ impl<T: UserAware> UserGlobalNameAware for T {
300300
}
301301

302302
pub trait BotStateAware {
303-
fn bot(&self) -> BotStateRef;
303+
fn bot(&'_ self) -> BotStateRef<'_>;
304304
}
305305

306306
pub trait OwnedBotStateAware: BotStateAware {

0 commit comments

Comments
 (0)