From e81fafc3d3d5c1661ef507b775869fe7b525b97e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vin=C3=ADcius=20Rodrigues=20Miguel?= Date: Wed, 3 Nov 2021 18:08:39 -0300 Subject: [PATCH] Make `Extension` non-exhaustive --- src/extension.rs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/extension.rs b/src/extension.rs index 24465c0..5e67407 100644 --- a/src/extension.rs +++ b/src/extension.rs @@ -6,6 +6,7 @@ use self::CompressionFormat::*; /// A wrapper around `CompressionFormat` that allows combinations like `tgz` #[derive(Debug, Clone, PartialEq, Eq)] +#[non_exhaustive] pub struct Extension { /// One extension like "tgz" can be made of multiple CompressionFormats ([Tar, Gz]) pub compression_formats: &'static [CompressionFormat], @@ -35,7 +36,7 @@ impl Extension { impl fmt::Display for Extension { fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { - f.write_str(&self.display_text) + self.display_text.fmt(f) } }