wip: nomralize

This commit is contained in:
okay stopped screaming 2026-03-21 23:29:20 +02:00
parent 35197fb826
commit 244e2b388e
16 changed files with 1880 additions and 1866 deletions

10
src/view.rs Normal file
View file

@ -0,0 +1,10 @@
use crate::*;
/// Collection of view definitions.
pub type Views = Arc<RwLock<BTreeMap<Arc<str>, Arc<str>>>>;
pub(crate) fn load_view (views: &Views, name: &impl AsRef<str>, body: &impl Language) -> Usually<()> {
views.write().unwrap().insert(name.as_ref().into(), body.src()?.unwrap_or_default().into());
Ok(())
}