[][src]Function genco::tokens::static_literal

pub fn static_literal<L>(s: &'static str) -> impl FormatInto<L> where
    L: Lang

Construct a formatter from a static string.

This is typically more efficient than using append() with a string directly, since it can avoid copying the string.

Examples

use genco::prelude::*;
use genco::tokens;

let mut tokens = Tokens::<()>::new();
tokens.append(tokens::static_literal("hello"));