I think I have worked around the lifetime issue by keeping references to the intermediate str's.

This commit is contained in:
Tom Alexander
2023-10-22 17:43:30 -04:00
parent 58aba8efd5
commit 043cc5eda4
3 changed files with 32 additions and 26 deletions

View File

@@ -2,11 +2,8 @@ use serde::Serialize;
use crate::error::CustomError;
pub(crate) trait RendererIntegration {
fn load_template<N, C>(&mut self, name: N, contents: C) -> Result<(), CustomError>
where
N: Into<String>,
C: AsRef<str>;
pub(crate) trait RendererIntegration<'a> {
fn load_template(&mut self, name: &'a str, contents: &'a str) -> Result<(), CustomError>;
fn render<C>(&self, context: C) -> Result<String, CustomError>
where