diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 81bc16a725a..95e36a1654c 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -170,6 +170,8 @@ jobs: cargo update base64ct --precise 1.7.3 cargo update deranged --precise 0.5.3 cargo update time --precise 0.3.40 + cargo update rustc-hash --precise 2.1.1 + cargo update hyper-rustls@0.27 --precise 0.27.7 - name: Check run: cargo check --features full diff --git a/Cargo.toml b/Cargo.toml index c37d2724ba5..3eecd345225 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -38,6 +38,7 @@ tokio = { version = "1.34.0", features = ["fs", "macros", "rt", "sync", "time", futures = { version = "0.3.32", default-features = false, features = ["std"] } time = { version = "0.3.36", features = ["formatting", "parsing", "serde-well-known"] } base64 = { version = "0.22.0" } +# serde feature only allows for serialisation secrecy = { version = "0.8.0", features = ["serde"] } arrayvec = { version = "0.7.4", features = ["serde"] } serde_cow = { version = "0.1.0" } @@ -60,7 +61,6 @@ dashmap = { version = "5.5.3", features = ["serde"], optional = true } parking_lot = { version = "0.12.1", optional = true } ed25519-dalek = { version = "2.0.0", optional = true } typesize = { version = "0.1.2", optional = true, features = ["url", "time", "serde_json", "secrecy", "dashmap", "parking_lot", "details"] } -# serde feature only allows for serialisation, # Serenity workspace crates command_attr = { version = "0.5.4", path = "./command_attr", optional = true } serenity-voice-model = { version = "0.2.1", path = "./voice-model", optional = true } diff --git a/src/framework/standard/help_commands.rs b/src/framework/standard/help_commands.rs index 4b5b6f4e1a3..9a948f9367c 100644 --- a/src/framework/standard/help_commands.rs +++ b/src/framework/standard/help_commands.rs @@ -906,7 +906,7 @@ fn flatten_group_to_string( let mut summary_or_prefixes = false; if let Some(group_summary) = group.summary { - writeln!(group_text, "{}*{group_summary}*", &repeated_indent_str)?; + writeln!(group_text, "{repeated_indent_str}*{group_summary}*")?; summary_or_prefixes = true; } @@ -914,7 +914,7 @@ fn flatten_group_to_string( writeln!( group_text, "{}{}: `{}`", - &repeated_indent_str, + repeated_indent_str, help_options.group_prefix, group.prefixes.join("`, `"), )?; @@ -1232,7 +1232,7 @@ fn grouped_commands_to_plain_string( result.push('\n'); for group in groups { - write!(result, "\n**{}**", &group.name).expect("writing to a string should never fail"); + write!(result, "\n**{}**", group.name).expect("writing to a string should never fail"); flatten_group_to_plain_string(&mut result, group, 0, help_options); } diff --git a/src/model/channel/attachment.rs b/src/model/channel/attachment.rs index 97fe4385c82..181340d4ce1 100644 --- a/src/model/channel/attachment.rs +++ b/src/model/channel/attachment.rs @@ -82,7 +82,7 @@ impl Attachment { /// If this attachment is an image, then a tuple of the width and height in pixels is returned. #[must_use] pub fn dimensions(&self) -> Option<(u32, u32)> { - self.width.and_then(|width| self.height.map(|height| (width, height))) + self.width.zip(self.height) } /// Downloads the attachment, returning back a vector of bytes. diff --git a/src/model/channel/message.rs b/src/model/channel/message.rs index 65fd6823f6b..5d8d6bad108 100644 --- a/src/model/channel/message.rs +++ b/src/model/channel/message.rs @@ -238,10 +238,9 @@ impl Message { let guild = cache.as_ref().guild(guild_id)?; let (channel, is_thread) = if let Some(channel) = guild.channels.get(&self.channel_id) { (channel, false) - } else if let Some(thread) = guild.threads.iter().find(|th| th.id == self.channel_id) { - (thread, true) } else { - return None; + let thread = guild.threads.iter().find(|th| th.id == self.channel_id)?; + (thread, true) }; let mut permissions = if let Some(member) = &self.member {