mirror of
https://github.com/revanced/revanced-discord-bot.git
synced 2025-04-30 06:24:27 +02:00
chore(clippy): fix clippy warnings (#2)
This commit is contained in:
parent
42098b9db5
commit
740d5b5f39
@ -35,8 +35,8 @@ async fn get_configuration_lock(ctx: &Context) -> Arc<RwLock<Configuration>> {
|
||||
.clone()
|
||||
}
|
||||
|
||||
fn contains_match(regex: &Vec<Regex>, text: &String) -> bool {
|
||||
regex.iter().any(|r| r.is_match(&text))
|
||||
fn contains_match(regex: &[Regex], text: &str) -> bool {
|
||||
regex.iter().any(|r| r.is_match(text))
|
||||
}
|
||||
|
||||
fn load_configuration() -> Configuration {
|
||||
@ -186,7 +186,7 @@ impl EventHandler for Handler {
|
||||
}
|
||||
|
||||
async fn thread_create(&self, ctx: Context, thread: GuildChannel) {
|
||||
if let Some(_) = thread.member {
|
||||
if thread.member.is_some() {
|
||||
trace!("Thread was joined. Block dispatch.");
|
||||
return;
|
||||
}
|
||||
|
@ -15,7 +15,7 @@ impl Configuration {
|
||||
fn save(&self) -> Result<(), Error> {
|
||||
let mut file = File::create("configuration.json")?;
|
||||
let json = serde_json::to_string_pretty(&self)?;
|
||||
file.write(json.as_bytes())?;
|
||||
file.write_all(json.as_bytes())?;
|
||||
Ok(())
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user