plain_text

Macro plain_text 

Source
macro_rules! plain_text {
    ($fmt:expr) => { ... };
    ($fmt:expr, $($arg:tt)+) => { ... };
}
Expand description

Shorthand to build Text object with type set to plain_text.

let text = plain_text!("Hello, World!");
let expected = Text::<Plain>::builder()
    .text("Hello, World!")
    .build();

assert_eq!(text, expected);

// You can use this like format! macro.
let greet = "Hi";
let name = "Tanaka";

let text = plain_text!("{greet}, {name}!");
let expected = Text::<Plain>::builder()
    .text("Hi, Tanaka!")
    .build();

assert_eq!(text, expected);