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,