refactor(serde): use serde derive macro
This commit is contained in:
parent
c86fef91a0
commit
bd1fc756bd
22 changed files with 203 additions and 422 deletions
|
|
@ -5,20 +5,25 @@ use memchr::memchr;
|
|||
///
|
||||
/// there are two types of clock: *closed* clock and *running* clock.
|
||||
#[cfg_attr(test, derive(PartialEq))]
|
||||
#[cfg_attr(feature = "serde", derive(serde::Serialize))]
|
||||
#[derive(Debug)]
|
||||
pub enum Clock<'a> {
|
||||
/// closed Clock
|
||||
Closed {
|
||||
start: Datetime<'a>,
|
||||
end: Datetime<'a>,
|
||||
#[cfg_attr(feature = "serde", serde(skip_serializing_if = "Option::is_none"))]
|
||||
repeater: Option<&'a str>,
|
||||
#[cfg_attr(feature = "serde", serde(skip_serializing_if = "Option::is_none"))]
|
||||
delay: Option<&'a str>,
|
||||
duration: &'a str,
|
||||
},
|
||||
/// running Clock
|
||||
Running {
|
||||
start: Datetime<'a>,
|
||||
#[cfg_attr(feature = "serde", serde(skip_serializing_if = "Option::is_none"))]
|
||||
repeater: Option<&'a str>,
|
||||
#[cfg_attr(feature = "serde", serde(skip_serializing_if = "Option::is_none"))]
|
||||
delay: Option<&'a str>,
|
||||
},
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue