From 7e3b727d0459b0434d4d0b02ec3fca242c300c44 Mon Sep 17 00:00:00 2001 From: Jonas Platte Date: Thu, 9 Dec 2021 15:50:42 +0100 Subject: [PATCH] Fix / silence clippy lints --- crates/ruma-identifiers-validation/src/server_name.rs | 3 +-- crates/ruma-state-res/src/lib.rs | 2 +- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/crates/ruma-identifiers-validation/src/server_name.rs b/crates/ruma-identifiers-validation/src/server_name.rs index 10fefefa..ef558147 100644 --- a/crates/ruma-identifiers-validation/src/server_name.rs +++ b/crates/ruma-identifiers-validation/src/server_name.rs @@ -1,7 +1,5 @@ use crate::error::Error; -// Clippy lint is buggy, should be fixed within the next week (as of 2021-10-29) -#[allow(clippy::question_mark)] pub fn validate(server_name: &str) -> Result<(), Error> { use std::net::Ipv6Addr; @@ -21,6 +19,7 @@ pub fn validate(server_name: &str) -> Result<(), Error> { end_of_ipv6 + 1 } else { + #[allow(clippy::unnecessary_lazy_evaluations)] let end_of_host = server_name.find(':').unwrap_or_else(|| server_name.len()); if server_name[..end_of_host] diff --git a/crates/ruma-state-res/src/lib.rs b/crates/ruma-state-res/src/lib.rs index 383a147a..c7882302 100644 --- a/crates/ruma-state-res/src/lib.rs +++ b/crates/ruma-state-res/src/lib.rs @@ -1095,7 +1095,7 @@ mod tests { vec!["o", "l", "n", "m", "p"], res.iter() .map(ToString::to_string) - .map(|s| s.replace("$", "").replace(":foo", "")) + .map(|s| s.replace('$', "").replace(":foo", "")) .collect::>() ) }