MCPcopy Create free account
hub / github.com/LPC4/Full-Stack / generate_userspace

Function generate_userspace

build.rs:62–82  ·  view source on GitHub ↗
(manifest_dir: &Path, out_dir: &Path)

Source from the content-addressed store, hash-verified

60 .unwrap_or_else(|_| panic!("shared theme color `{name}` is not hexadecimal"));
61 let constant = name.replace('-', "_").to_ascii_uppercase();
62 writeln!(
63 code,
64 "pub const {constant}: Color32 = Color32::from_rgb(0x{:02X}, 0x{:02X}, 0x{:02X});",
65 (rgb >> 16) & 0xFF,
66 (rgb >> 8) & 0xFF,
67 rgb & 0xFF
68 )
69 .expect("write theme constant");
70 colors += 1;
71 }
72
73 assert!(colors >= 20, "shared theme palette is unexpectedly small");
74 fs::write(out_dir.join("theme_palette.rs"), code).expect("write generated theme palette");
75}
76
77fn collect_rs_files(dir: &Path, files: &mut Vec<PathBuf>) {
78 if let Ok(entries) = fs::read_dir(dir) {
79 for entry in entries.flatten() {
80 let path = entry.path();
81 if path.is_dir() {
82 collect_rs_files(&path, files);
83 } else if path.extension().and_then(|ext| ext.to_str()) == Some("rs") {
84 files.push(path);
85 }

Callers 1

mainFunction · 0.85

Calls 6

collect_source_filesFunction · 0.85
render_userspaceFunction · 0.85
render_source_filesFunction · 0.85
collectMethod · 0.80
rankMethod · 0.80
collect_build_filesFunction · 0.70

Tested by

no test coverage detected