Lines
100 %
Functions
75 %
Branches
//! Field addresses: a flat field is its key, row `i` of a `rows` field is
//! `key.i` and a cell of that row is `key.i.sub`. The index is any display,
//! so a template row can carry a placeholder.
use std::fmt::Display;
/// The address of row `index` of the `rows` field `key`.
#[must_use]
pub fn row(key: &str, index: impl Display) -> String {
format!("{key}.{index}")
}
/// The address of cell `sub` in row `index` of the `rows` field `key`.
pub fn cell(key: &str, index: impl Display, sub: &str) -> String {
format!("{key}.{index}.{sub}")