diff options
author | Erik Johnston <erik@matrix.org> | 2022-09-07 16:14:51 +0100 |
---|---|---|
committer | Erik Johnston <erik@matrix.org> | 2022-09-09 15:10:52 +0100 |
commit | bbba09e583e96d7e54086b47707e4a0b9f995cc2 (patch) | |
tree | 30b98eb7839d827c6819a03bc424b0bce4f3f382 | |
parent | Fixup (diff) | |
download | synapse-bbba09e583e96d7e54086b47707e4a0b9f995cc2.tar.xz |
fix up
-rw-r--r-- | rust/src/push/mod.rs | 12 | ||||
-rw-r--r-- | rust/src/push/utils.rs | 2 |
2 files changed, 7 insertions, 7 deletions
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}"); } |