1
//! Field addresses: a flat field is its key, row `i` of a `rows` field is
2
//! `key.i` and a cell of that row is `key.i.sub`. The index is any display,
3
//! so a template row can carry a placeholder.
4

            
5
use std::fmt::Display;
6

            
7
/// The address of row `index` of the `rows` field `key`.
8
#[must_use]
9
198386
pub fn row(key: &str, index: impl Display) -> String {
10
198386
    format!("{key}.{index}")
11
198386
}
12

            
13
/// The address of cell `sub` in row `index` of the `rows` field `key`.
14
#[must_use]
15
1461890
pub fn cell(key: &str, index: impl Display, sub: &str) -> String {
16
1461890
    format!("{key}.{index}.{sub}")
17
1461890
}