From 68ba8f6e62c7c0a12e3a62cffa2f1cdf7d1f5f30 Mon Sep 17 00:00:00 2001 From: Jonathan Giddy Date: Thu, 24 Aug 2023 08:49:40 +0100 Subject: [PATCH] Use explicit Default for GzHeaderState enum This allows the crate to build with Rust older than 1.62. --- src/gz/mod.rs | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/gz/mod.rs b/src/gz/mod.rs index e8e05c6e..31a69611 100644 --- a/src/gz/mod.rs +++ b/src/gz/mod.rs @@ -87,7 +87,7 @@ impl GzHeader { } } -#[derive(Debug, Default)] +#[derive(Debug)] pub enum GzHeaderState { Start(u8, [u8; 10]), Xlen(Option>, u8, [u8; 2]), @@ -95,10 +95,15 @@ pub enum GzHeaderState { Filename(Option>), Comment(Option>), Crc(Option>, u8, [u8; 2]), - #[default] Complete, } +impl Default for GzHeaderState { + fn default() -> Self { + Self::Complete + } +} + #[derive(Debug, Default)] pub struct GzHeaderParser { state: GzHeaderState,