summaryrefslogtreecommitdiff
path: root/src/utils.rs
diff options
context:
space:
mode:
authorseth <[email protected]>2023-12-15 03:17:20 -0500
committerseth <[email protected]>2023-12-15 16:41:13 -0500
commit8d22f09089b13d013cf94526c205f374bdf873c3 (patch)
tree505c864e5683e6ece7d2ead2f9e019b8cc797548 /src/utils.rs
parentebdcc85dc7c80796446535fa2799bb62f2c12aac (diff)
enable clippy::all, clippy::pedantic, & clippy::perf
Diffstat (limited to 'src/utils.rs')
-rw-r--r--src/utils.rs3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/utils.rs b/src/utils.rs
index e4ac03e..1a96359 100644
--- a/src/utils.rs
+++ b/src/utils.rs
@@ -19,6 +19,7 @@ pub fn random_choice<const N: usize>(arr: [&str; N]) -> Result<String> {
}
// waiting for `round_char_boundary` to stabilize
+#[allow(clippy::cast_possible_wrap)]
pub fn floor_char_boundary(s: &str, index: usize) -> usize {
if index >= s.len() {
s.len()
@@ -105,7 +106,7 @@ pub async fn resolve_message_to_embed(ctx: &serenity::Context, msg: &Message) ->
if attachments_len > 1 {
embed.footer(|footer| {
// yes it will say '1 attachments' no i do not care
- footer.text(format!("{} attachments", attachments_len))
+ footer.text(format!("{attachments_len} attachments"))
});
}