convert hand-written enum as_str matches to strum derives workspace-wide
This commit is contained in:
parent
0d6c003fa8
commit
299add158f
14 changed files with 70 additions and 113 deletions
|
|
@ -14,7 +14,8 @@ use crate::body;
|
|||
use crate::client::{Client, index};
|
||||
use crate::verbs::print_json;
|
||||
|
||||
#[derive(Copy, Clone, ValueEnum)]
|
||||
#[derive(Copy, Clone, ValueEnum, strum::IntoStaticStr)]
|
||||
#[strum(serialize_all = "snake_case")]
|
||||
pub enum StateArg {
|
||||
Open,
|
||||
Closed,
|
||||
|
|
@ -22,10 +23,7 @@ pub enum StateArg {
|
|||
|
||||
impl StateArg {
|
||||
fn as_str(self) -> &'static str {
|
||||
match self {
|
||||
Self::Open => "open",
|
||||
Self::Closed => "closed",
|
||||
}
|
||||
self.into()
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue