From 9b71f91b6992c7f003d7d5ef80f4abb980f3d1d4 Mon Sep 17 00:00:00 2001 From: gennyble Date: Sat, 15 Jul 2023 19:00:17 -0500 Subject: use bit constants for disposal match --- gifed/src/block/extension/graphiccontrol.rs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/gifed/src/block/extension/graphiccontrol.rs b/gifed/src/block/extension/graphiccontrol.rs index 31cc961..578fa99 100644 --- a/gifed/src/block/extension/graphiccontrol.rs +++ b/gifed/src/block/extension/graphiccontrol.rs @@ -41,10 +41,10 @@ impl GraphicControl { /// is recognized, or None if it was set to a reserved value. pub fn disposal_method(&self) -> Option { match self.packed.disposal_method() { - 0 => Some(DisposalMethod::NoAction), - 1 => Some(DisposalMethod::DoNotDispose), - 2 => Some(DisposalMethod::RestoreBackground), - 3 => Some(DisposalMethod::RestorePrevious), + 0b000 => Some(DisposalMethod::NoAction), + 0b001 => Some(DisposalMethod::DoNotDispose), + 0b010 => Some(DisposalMethod::RestoreBackground), + 0b011 => Some(DisposalMethod::RestorePrevious), _ => None, } } -- cgit 1.4.1-3-g733a5