jid: clippy run

Signed-off-by: Maxime “pep” Buquet <pep@bouah.net>
This commit is contained in:
Maxime “pep” Buquet 2025-04-07 21:09:44 +02:00
commit 4c2fac0ac3
2 changed files with 6 additions and 4 deletions

View file

@ -101,10 +101,11 @@ fn domain_check(mut domain: &str) -> Result<Cow<'_, str>, 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

View file

@ -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<Cow<'_, $borrowed>, Error> {
let part = $check_fn(s)?;
match part {