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()
|
.clone()
|
||||||
}
|
}
|
||||||
|
|
||||||
fn contains_match(regex: &Vec<Regex>, text: &String) -> bool {
|
fn contains_match(regex: &[Regex], text: &str) -> bool {
|
||||||
regex.iter().any(|r| r.is_match(&text))
|
regex.iter().any(|r| r.is_match(text))
|
||||||
}
|
}
|
||||||
|
|
||||||
fn load_configuration() -> Configuration {
|
fn load_configuration() -> Configuration {
|
||||||
@ -186,7 +186,7 @@ impl EventHandler for Handler {
|
|||||||
}
|
}
|
||||||
|
|
||||||
async fn thread_create(&self, ctx: Context, thread: GuildChannel) {
|
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.");
|
trace!("Thread was joined. Block dispatch.");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
@ -15,7 +15,7 @@ impl Configuration {
|
|||||||
fn save(&self) -> Result<(), Error> {
|
fn save(&self) -> Result<(), Error> {
|
||||||
let mut file = File::create("configuration.json")?;
|
let mut file = File::create("configuration.json")?;
|
||||||
let json = serde_json::to_string_pretty(&self)?;
|
let json = serde_json::to_string_pretty(&self)?;
|
||||||
file.write(json.as_bytes())?;
|
file.write_all(json.as_bytes())?;
|
||||||
Ok(())
|
Ok(())
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user