From 0efde0e134fe1254c567620564af3e9749c6e768 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rn-Michael=20Miehe?= <40151420+ldericher@users.noreply.github.com> Date: Thu, 3 Jul 2025 14:21:02 +0000 Subject: [PATCH] clippy fix --- src/error.rs | 1 + src/sharry/uri.rs | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/src/error.rs b/src/error.rs index 6d9ecc9..400776f 100644 --- a/src/error.rs +++ b/src/error.rs @@ -121,6 +121,7 @@ impl Error { } } + #[must_use] pub fn get_invalid_param(&self) -> Option<&Parameter> { if let Self::InvalidParameter(p) = self { Some(p) diff --git a/src/sharry/uri.rs b/src/sharry/uri.rs index 2a257a5..5134574 100644 --- a/src/sharry/uri.rs +++ b/src/sharry/uri.rs @@ -37,7 +37,7 @@ impl From for Uri { SHARRY_URI_RE.captures(value).map(|caps| { let captured = |name| { caps.name(name) - .expect(&format!("{name} not captured")) + .unwrap_or_else(|| panic!("{name} not captured")) .as_str() .to_string() };