INNER CODE UNIT · Rust
fmt
jub0t/Concat · src/crates/concat-api/src/lib.rs:91
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
f.write_str(match self {
Holder::Window => "the window",
Holder::Api => "the API",
})
}
}
/// The project folders open on this machine and who has each, shared
/// between a window and the API it embeds, so neither opens a folder the
/// other is editing and saves over its work (audit 2026-09-23, #5). Cheap
/// to clone; every clone is the same register.
#[derive(Clone, Default)]
pub struct OpenProjects(Arc<Mutex<BTreeMap<String, Holder>>>);
impl OpenProjects {
/// Claims `path` for `holder`. Refused, naming who has it, when the
/// other side does; claiming again what one already holds is fine.