Skip to content

Commit 55875d7

Browse files
authored
Derive Default trait for DataType (#100)
1 parent a3508fe commit 55875d7

File tree

1 file changed

+2
-7
lines changed

1 file changed

+2
-7
lines changed

src/types.rs

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -657,20 +657,15 @@ pub fn creation_time(creation_time: u64) -> u64 {
657657
}
658658
}
659659

660-
#[derive(Debug, Clone, PartialEq, Eq, Serialize)]
660+
#[derive(Debug, Default, Clone, PartialEq, Eq, Serialize)]
661661
pub enum DataType {
662+
#[default]
662663
Binary = 0x000000,
663664
Text = 0x000001,
664665
Image = 0x00000D,
665666
TempoCpil = 0x000015,
666667
}
667668

668-
impl std::default::Default for DataType {
669-
fn default() -> Self {
670-
DataType::Binary
671-
}
672-
}
673-
674669
impl TryFrom<u32> for DataType {
675670
type Error = Error;
676671
fn try_from(value: u32) -> Result<DataType> {

0 commit comments

Comments
 (0)