1
0
Fork 0
mirror of https://github.com/alfg/mp4-rust.git synced 2024-06-02 13:39:54 +00:00

Derive Default trait for DataType

This commit is contained in:
Linus Unnebäck 2023-03-19 13:17:25 +07:00
parent 7cfdffbd71
commit 80b676256d
No known key found for this signature in database
GPG key ID: CE70CEAE9C0FA66F

View file

@ -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 {
#[default]
Binary = 0x000000,
Text = 0x000001,
Image = 0x00000D,
TempoCpil = 0x000015,
}
impl std::default::Default for DataType {
fn default() -> Self {
DataType::Binary
}
}
impl TryFrom<u32> for DataType {
type Error = Error;
fn try_from(value: u32) -> Result<DataType> {