lunar-lib 0.1.0

Common utilities for lunar applications
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
use crate::formatter::{FormatTable, Render, format_args::FormatArg};

#[derive(Debug, Clone, Default)]
pub(super) struct Tag<'a> {
    pub args: Vec<FormatArg<'a>>,
}

impl<'a> Render for Tag<'a> {
    fn render(&self, format_table: &FormatTable) -> String {
        let key = self.args.render(format_table);
        format_table.table().get(&key).cloned().unwrap_or_default()
    }
}