diff options
author | Genny <gen@nyble.dev> | 2021-09-15 22:16:30 -0500 |
---|---|---|
committer | Genny <gen@nyble.dev> | 2021-09-15 22:16:30 -0500 |
commit | 7b8081a79fb3db4a76f9e4cca8f8a88e6e7f873c (patch) | |
tree | 5eab8cbf47698b031c12f8eadc4c55f674f70c01 /src/block/version.rs | |
parent | cdedae673268c372beb27c6d2f123cdf21f630f1 (diff) | |
download | gifed-7b8081a79fb3db4a76f9e4cca8f8a88e6e7f873c.tar.gz gifed-7b8081a79fb3db4a76f9e4cca8f8a88e6e7f873c.zip |
Reading, fix writing, monocommit
Diffstat (limited to 'src/block/version.rs')
-rw-r--r-- | src/block/version.rs | 29 |
1 files changed, 20 insertions, 9 deletions
diff --git a/src/block/version.rs b/src/block/version.rs index a5d688d..b785f27 100644 --- a/src/block/version.rs +++ b/src/block/version.rs @@ -1,13 +1,24 @@ +use std::fmt; + pub enum Version { - Gif87a, - Gif89a + Gif87a, + Gif89a, } impl From<&Version> for &[u8] { - fn from(version: &Version) -> Self { - match version { - Version::Gif87a => b"GIF87a", - Version::Gif89a => b"GIF89a" - } - } -} \ No newline at end of file + 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"), + } + } +} |