From 4c2fac0ac3fbd882451b6db0618f188152ad2798 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Maxime=20=E2=80=9Cpep=E2=80=9D=20Buquet?= Date: Mon, 7 Apr 2025 21:09:44 +0200 Subject: [PATCH] jid: clippy run MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Maxime “pep” Buquet --- jid/src/lib.rs | 9 +++++---- jid/src/parts.rs | 1 + 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/jid/src/lib.rs b/jid/src/lib.rs index 082819a7..0aca6558 100644 --- a/jid/src/lib.rs +++ b/jid/src/lib.rs @@ -101,10 +101,11 @@ fn domain_check(mut domain: &str) -> Result, Error> { } // Then if this is an IPv6 address. - if domain.starts_with('[') && domain.ends_with(']') { - if Ipv6Addr::from_str(&domain[1..domain.len() - 1]).is_ok() { - return Ok(Cow::Borrowed(domain)); - } + if domain.starts_with('[') + && domain.ends_with(']') + && Ipv6Addr::from_str(&domain[1..domain.len() - 1]).is_ok() + { + return Ok(Cow::Borrowed(domain)); } // idna can handle the root dot for us, but we still want to remove it for normalization diff --git a/jid/src/parts.rs b/jid/src/parts.rs index c64ea790..4ae513e2 100644 --- a/jid/src/parts.rs +++ b/jid/src/parts.rs @@ -59,6 +59,7 @@ macro_rules! def_part_types { impl $name { #[doc = def_part_parse_doc!($name, str, "Depending on whether the contents are changed by normalisation operations, this function either returns a copy or a reference to the original data.")] + #[allow(clippy::new_ret_no_self)] pub fn new(s: &str) -> Result, Error> { let part = $check_fn(s)?; match part {