Update rust

This commit is contained in:
jude
2024-02-22 18:35:37 +00:00
parent 6c20bf2a0f
commit dd7e681285
8 changed files with 6 additions and 13 deletions

View File

@ -10,9 +10,9 @@ pub const CHARACTERS: &str = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWX
const THEME_COLOR_FALLBACK: u32 = 0x8fb677;
pub const MACRO_MAX_COMMANDS: usize = 5;
use poise::serenity_prelude::CreateAttachment;
use std::{collections::HashSet, env, iter::FromIterator};
use std::{collections::HashSet, env};
use poise::serenity_prelude::CreateAttachment;
use regex::Regex;
lazy_static! {

View File

@ -95,16 +95,12 @@ impl fmt::Display for Error {
trait OverflowOp: Sized {
fn mul(self, other: Self) -> Result<Self, Error>;
fn add(self, other: Self) -> Result<Self, Error>;
}
impl OverflowOp for u64 {
fn mul(self, other: Self) -> Result<Self, Error> {
self.checked_mul(other).ok_or(Error::NumberOverflow)
}
fn add(self, other: Self) -> Result<Self, Error> {
self.checked_add(other).ok_or(Error::NumberOverflow)
}
}
#[derive(Copy, Clone)]

View File

@ -1,5 +1,4 @@
use std::{
convert::TryFrom,
fmt::{Display, Formatter, Result as FmtResult},
str::from_utf8,
time::{SystemTime, UNIX_EPOCH},