From d95a4f25e05c428a58b7e06b0e8cb1b159f64e55 Mon Sep 17 00:00:00 2001 From: Shannon Sterz Date: Thu, 6 Mar 2025 13:43:38 +0100 Subject: [PATCH] router: allow `from_str` on Confirmation that is not for `FromStr` while usually this would improve ergonomics, in this case it isn't clear whether all uses of `FromStr` would be considered valid here. renaming the function would also make the type more confusing to use as `from_str_with_default` also exists, so keep this for consistency. this ignores a clippy lint [1]. [1]: https://rust-lang.github.io/rust-clippy/master/index.html#should_implement_trait Signed-off-by: Shannon Sterz --- proxmox-router/src/cli/mod.rs | 1 + 1 file changed, 1 insertion(+) diff --git a/proxmox-router/src/cli/mod.rs b/proxmox-router/src/cli/mod.rs index 2393da31..7c409f06 100644 --- a/proxmox-router/src/cli/mod.rs +++ b/proxmox-router/src/cli/mod.rs @@ -117,6 +117,7 @@ impl Confirmation { /// let answer = Confirmation::from_str("bogus"); /// assert!(answer.is_err()); /// ``` + #[allow(clippy::should_implement_trait)] pub fn from_str(input: &str) -> Result { match input.trim() { "y" | "Y" => Ok(Self::Yes),