mirror of
https://github.com/alfg/mp4-rust.git
synced 2025-02-23 08:16:16 +00:00
Derive Default trait for DataType (#100)
This commit is contained in:
parent
a3508fe1c9
commit
55875d72de
1 changed files with 2 additions and 7 deletions
|
@ -657,20 +657,15 @@ pub fn creation_time(creation_time: u64) -> u64 {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Debug, Clone, PartialEq, Eq, Serialize)]
|
#[derive(Debug, Default, Clone, PartialEq, Eq, Serialize)]
|
||||||
pub enum DataType {
|
pub enum DataType {
|
||||||
|
#[default]
|
||||||
Binary = 0x000000,
|
Binary = 0x000000,
|
||||||
Text = 0x000001,
|
Text = 0x000001,
|
||||||
Image = 0x00000D,
|
Image = 0x00000D,
|
||||||
TempoCpil = 0x000015,
|
TempoCpil = 0x000015,
|
||||||
}
|
}
|
||||||
|
|
||||||
impl std::default::Default for DataType {
|
|
||||||
fn default() -> Self {
|
|
||||||
DataType::Binary
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
impl TryFrom<u32> for DataType {
|
impl TryFrom<u32> for DataType {
|
||||||
type Error = Error;
|
type Error = Error;
|
||||||
fn try_from(value: u32) -> Result<DataType> {
|
fn try_from(value: u32) -> Result<DataType> {
|
||||||
|
|
Loading…
Reference in a new issue