1pub mod bench;
9pub mod book_page;
10pub mod recipe_area;
11pub mod cargo_toml;
12pub mod content;
13pub mod exports;
14pub mod manifest;
15pub mod yres;
16pub mod yui;
17pub mod yui_component;
18pub mod yui_grid;
19pub mod yui_vm;
20
21pub(crate) fn write_if_changed(path: &std::path::Path, code: &str) -> Result<(), String> {
25 if std::fs::read_to_string(path).ok().as_deref() == Some(code) {
26 return Ok(());
27 }
28 if let Some(dir) = path.parent() {
29 std::fs::create_dir_all(dir).map_err(|e| format!("{}: {e}", dir.display()))?;
30 }
31 std::fs::write(path, code).map_err(|e| format!("{}: {e}", path.display()))
32}