From daa8d89b579f9a319e2bd9c59576e1d8ac76365e Mon Sep 17 00:00:00 2001 From: Dirkjan Ochtman Date: Fri, 29 Sep 2023 14:02:11 +0200 Subject: Add MSRV checking in CI Bump MSRV to 1.65 for the use of let .. else. --- askama_derive/Cargo.toml | 2 +- askama_derive/src/config.rs | 9 ++------- 2 files changed, 3 insertions(+), 8 deletions(-) (limited to 'askama_derive') diff --git a/askama_derive/Cargo.toml b/askama_derive/Cargo.toml index cb4635f..5c3d8fa 100644 --- a/askama_derive/Cargo.toml +++ b/askama_derive/Cargo.toml @@ -8,7 +8,7 @@ license = "MIT/Apache-2.0" workspace = ".." readme = "README.md" edition = "2021" -rust-version = "1.58" +rust-version = "1.65" [lib] proc-macro = true diff --git a/askama_derive/src/config.rs b/askama_derive/src/config.rs index a4eec28..b2a13aa 100644 --- a/askama_derive/src/config.rs +++ b/askama_derive/src/config.rs @@ -203,11 +203,12 @@ impl RawConfig<'_> { } } -#[derive(Clone, Copy, PartialEq, Eq, Debug)] +#[derive(Clone, Copy, Default, PartialEq, Eq, Debug)] #[cfg_attr(feature = "serde", derive(Deserialize))] #[cfg_attr(feature = "serde", serde(field_identifier, rename_all = "lowercase"))] pub(crate) enum WhitespaceHandling { /// The default behaviour. It will leave the whitespace characters "as is". + #[default] Preserve, /// It'll remove all the whitespace characters before and after the jinja block. Suppress, @@ -227,12 +228,6 @@ impl From for Whitespace { } } -impl Default for WhitespaceHandling { - fn default() -> Self { - WhitespaceHandling::Preserve - } -} - #[cfg_attr(feature = "serde", derive(Deserialize))] struct General<'a> { #[cfg_attr(feature = "serde", serde(borrow))] -- cgit