Function text_grid::cell_by

source ·
pub fn cell_by<F: Fn(&mut String) -> Result>(f: F) -> Cell<impl RawCell>
Expand description

Create Cell from closure that call std::write! macro.

§Examples

use text_grid::*;
use std::fmt::Write;

let s = String::from("ABC");
let cell_a = cell_by(|f| write!(f, "{}", &s));
let cell_b = cell_by(|f| write!(f, "{}", &s));