mirror of
https://git.proxmox.com/git/proxmox
synced 2025-04-28 15:25:44 +00:00
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 <s.sterz@proxmox.com>
This commit is contained in:
parent
92ecc301b6
commit
d95a4f25e0
@ -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<Self, Error> {
|
||||
match input.trim() {
|
||||
"y" | "Y" => Ok(Self::Yes),
|
||||
|
Loading…
Reference in New Issue
Block a user