about summary refs log tree commit diff
path: root/src/block/version.rs
blob: b785f277d1cc1971f199c5e4e726feebf9f2041b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
use std::fmt;

pub enum Version {
    Gif87a,
    Gif89a,
}

impl From<&Version> for &[u8] {
    fn from(version: &Version) -> Self {
        match version {
            Version::Gif87a => b"GIF87a",
            Version::Gif89a => b"GIF89a",
        }
    }
}

impl fmt::Display for Version {
    fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
        match self {
            Version::Gif87a => write!(f, "GIF87a"),
            Version::Gif89a => write!(f, "GIF89a"),
        }
    }
}