genco::tokens

Function static_literal

Source
pub fn static_literal(literal: &'static str) -> StaticLiteral
Expand description

A formatter from a static literal.

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"));