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() };