...
This commit is contained in:
@@ -31,6 +31,7 @@ impl ReplacementOperation {
|
||||
|
||||
/// Text replacer that can perform multiple replacement operations
|
||||
/// in a single pass over the input text.
|
||||
#[derive(Clone)]
|
||||
pub struct TextReplacer {
|
||||
operations: Vec<ReplacementOperation>,
|
||||
}
|
||||
@@ -82,7 +83,7 @@ impl TextReplacer {
|
||||
}
|
||||
|
||||
/// Builder for the TextReplacer.
|
||||
#[derive(Default)]
|
||||
#[derive(Default, Clone)]
|
||||
pub struct TextReplacerBuilder {
|
||||
operations: Vec<ReplacementOperation>,
|
||||
pattern: Option<String>,
|
||||
|
@@ -5,6 +5,7 @@ use std::path::Path;
|
||||
use tera::{Context, Tera};
|
||||
|
||||
/// A builder for creating and rendering templates using the Tera template engine.
|
||||
#[derive(Clone)]
|
||||
pub struct TemplateBuilder {
|
||||
template_path: String,
|
||||
context: Context,
|
||||
@@ -254,7 +255,7 @@ mod tests {
|
||||
fn test_template_with_hashmap_vars() -> Result<(), Box<dyn std::error::Error>> {
|
||||
// Create a temporary template file
|
||||
let mut temp_file = NamedTempFile::new()?;
|
||||
writeln!(temp_file, "{{ greeting }}, {{ name }}!")?;
|
||||
writeln!(temp_file, "{{{{ greeting }}}}, {{{{ name }}}}!")?;
|
||||
temp_file.flush()?;
|
||||
|
||||
// Create a HashMap of variables
|
||||
|
Reference in New Issue
Block a user