diff --git a/rust/src/push/mod.rs b/rust/src/push/mod.rs
index d59a140ee1..e56fac40a7 100644
--- a/rust/src/push/mod.rs
+++ b/rust/src/push/mod.rs
@@ -5,14 +5,14 @@
//! allocation atm).
use std::borrow::Cow;
-use std::collections::{BTreeMap, BTreeSet, HashMap, HashSet};
+use std::collections::{BTreeMap, BTreeSet, HashMap};
use anyhow::{Context, Error};
use lazy_static::lazy_static;
-use log::{info, warn};
+use log::warn;
use pyo3::prelude::*;
use pythonize::pythonize;
-use regex::{Regex, RegexBuilder};
+use regex::Regex;
use serde::de::Error as _;
use serde::{Deserialize, Serialize};
use serde_json::Value;
@@ -105,7 +105,7 @@ impl PushRule {
}
}
-#[derive(Debug, Clone, PartialEq)]
+#[derive(Debug, Clone, PartialEq, Eq)]
pub enum Action {
DontNotify,
Notify,
@@ -119,7 +119,7 @@ impl IntoPy<PyObject> for Action {
}
}
-#[derive(Serialize, Deserialize, Debug, Clone, PartialEq)]
+#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq)]
pub struct SetTweak {
set_tweak: Cow<'static, str>,
value: Option<TweakValue>,
@@ -130,7 +130,7 @@ pub struct SetTweak {
other_keys: Value,
}
-#[derive(Serialize, Deserialize, Debug, Clone, PartialEq)]
+#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq)]
#[serde(untagged)]
pub enum TweakValue {
String(Cow<'static, str>),
diff --git a/rust/src/push/utils.rs b/rust/src/push/utils.rs
index 37e5f7fc10..d070d8f0d2 100644
--- a/rust/src/push/utils.rs
+++ b/rust/src/push/utils.rs
@@ -13,7 +13,7 @@ pub(crate) fn get_localpart_from_id(id: &str) -> Result<&str, Error> {
.with_context(|| format!("ID does not contain colon: {id}"))?;
// We need to strip off the first character, which is the ID type.
- if localpart.len() == 0 {
+ if localpart.is_empty() {
bail!("Invalid ID {id}");
}
|