Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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" }
Expand All @@ -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 }
Expand Down
6 changes: 3 additions & 3 deletions src/framework/standard/help_commands.rs
Original file line number Diff line number Diff line change
Expand Up @@ -906,15 +906,15 @@ 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;
}

if !group.prefixes.is_empty() {
writeln!(
group_text,
"{}{}: `{}`",
&repeated_indent_str,
repeated_indent_str,
help_options.group_prefix,
group.prefixes.join("`, `"),
)?;
Expand Down Expand Up @@ -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);
}
Expand Down
2 changes: 1 addition & 1 deletion src/model/channel/attachment.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
5 changes: 2 additions & 3 deletions src/model/channel/message.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
Loading