espeak_ng_data_dict_om/
lib.rs1include!(concat!(env!("OUT_DIR"), "/files.rs"));
13
14pub fn install(dest_dir: &std::path::Path) -> std::io::Result<()> {
16 for (rel_path, data) in ALL_FILES {
17 let dest = dest_dir.join(rel_path);
18 if let Some(parent) = dest.parent() {
19 std::fs::create_dir_all(parent)?;
20 }
21 std::fs::write(dest, data)?;
22 }
23 Ok(())
24}
25
26#[cfg(test)]
27mod tests {
28 use super::*;
29
30 #[test]
31 fn all_files_nonempty() {
32 assert!(!ALL_FILES.is_empty(), "ALL_FILES must not be empty");
33 for (path, data) in ALL_FILES {
34 assert!(!data.is_empty(), "embedded file {path:?} is empty");
35 }
36 }
37}