From 37893a3f748ff336f0f591548094df8307aba801 Mon Sep 17 00:00:00 2001 From: Federico Terzi Date: Mon, 13 Dec 2021 23:08:00 +0100 Subject: [PATCH] fix(render): fix clippy warning --- espanso-render/src/lib.rs | 22 ++-------------------- 1 file changed, 2 insertions(+), 20 deletions(-) diff --git a/espanso-render/src/lib.rs b/espanso-render/src/lib.rs index 0517f9f..29296ce 100644 --- a/espanso-render/src/lib.rs +++ b/espanso-render/src/lib.rs @@ -42,20 +42,12 @@ pub enum RenderResult { Error(anyhow::Error), } +#[derive(Default)] pub struct Context<'a> { pub global_vars: Vec<&'a Variable>, pub templates: Vec<&'a Template>, } -impl<'a> Default for Context<'a> { - fn default() -> Self { - Self { - global_vars: Vec::new(), - templates: Vec::new(), - } - } -} - #[derive(Debug, Clone, PartialEq)] pub struct RenderOptions { pub casing_style: CasingStyle, @@ -77,23 +69,13 @@ pub enum CasingStyle { Uppercase, } -#[derive(Debug, Clone, PartialEq)] +#[derive(Debug, Clone, PartialEq, Default)] pub struct Template { pub ids: Vec, pub body: String, pub vars: Vec, } -impl Default for Template { - fn default() -> Self { - Self { - ids: Vec::new(), - body: "".to_string(), - vars: Vec::new(), - } - } -} - #[derive(Debug, Clone, PartialEq)] pub struct Variable { pub name: String,