chore: 修复新的 clippy warnings (#467)

This commit is contained in:
ᴀᴍᴛᴏᴀᴇʀ
2025-09-24 17:36:20 +08:00
committed by GitHub
parent 4db7e6763a
commit b441f04cdf
12 changed files with 87 additions and 100 deletions

View File

@@ -108,11 +108,11 @@ where
{
let pattern = String::deserialize(deserializer)?;
// 反序列化时预编译 regex优化性能
let regex = regex::Regex::new(&pattern).map_err(|e| serde::de::Error::custom(e))?;
let regex = regex::Regex::new(&pattern).map_err(serde::de::Error::custom)?;
Ok((pattern, regex))
}
fn serialize_regex<S>(pattern: &String, _regex: &regex::Regex, serializer: S) -> Result<S::Ok, S::Error>
fn serialize_regex<S>(pattern: &str, _regex: &regex::Regex, serializer: S) -> Result<S::Ok, S::Error>
where
S: Serializer,
{