about summary refs log tree commit diff
path: root/src/lib.rs
diff options
context:
space:
mode:
authorGenny <gen@nyble.dev>2021-10-11 03:36:38 -0500
committerGenny <gen@nyble.dev>2021-10-11 03:36:38 -0500
commit757eab88d67a425728b87286c763387f52367196 (patch)
treef1d61edb0a838787f6984accdd92df68a69d567a /src/lib.rs
parent9b7bd5696a21496fa0c38a17e69c5c0658acfe73 (diff)
downloadgifed-757eab88d67a425728b87286c763387f52367196.tar.gz
gifed-757eab88d67a425728b87286c763387f52367196.zip
Run rustfmt
Diffstat (limited to 'src/lib.rs')
-rw-r--r--src/lib.rs32
1 files changed, 16 insertions, 16 deletions
diff --git a/src/lib.rs b/src/lib.rs
index c7d820d..0a11fdc 100644
--- a/src/lib.rs
+++ b/src/lib.rs
@@ -18,7 +18,7 @@ pub use lzw::LZW;
 /// Perform the algorithm to get the length of a color table from
 /// the value of the packed field. The max value here is 256
 pub(crate) fn packed_to_color_table_length(packed: u8) -> usize {
-    2usize.pow(packed as u32 + 1)
+	2usize.pow(packed as u32 + 1)
 }
 
 //TODO: Be sure to check that fields in LSD and Img. Desc. that were reserved
@@ -28,24 +28,24 @@ pub(crate) fn packed_to_color_table_length(packed: u8) -> usize {
 
 #[derive(Clone, Copy, Debug)]
 pub enum EncodingError {
-    TooManyColors,
-    NoColorTable,
-    IndicieSizeMismatch { expected: usize, got: usize },
+	TooManyColors,
+	NoColorTable,
+	IndicieSizeMismatch { expected: usize, got: usize },
 }
 
 impl fmt::Display for EncodingError {
-    fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
-        match self {
-            Self::TooManyColors => write!(f, "A palette is limited to 256 colors"),
-            Self::NoColorTable => write!(
-                f,
-                "Refusing to set the background color index when no color table is set!"
-            ),
-            Self::IndicieSizeMismatch { expected, got } => {
-                write!(f, "Expected to have {} indicies but got {}", expected, got)
-            }
-        }
-    }
+	fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
+		match self {
+			Self::TooManyColors => write!(f, "A palette is limited to 256 colors"),
+			Self::NoColorTable => write!(
+				f,
+				"Refusing to set the background color index when no color table is set!"
+			),
+			Self::IndicieSizeMismatch { expected, got } => {
+				write!(f, "Expected to have {} indicies but got {}", expected, got)
+			}
+		}
+	}
 }
 
 impl Error for EncodingError {}