improved code quality

This commit is contained in:
2026-06-01 13:10:46 +02:00
parent aff15f67c7
commit be6d2de39c
3 changed files with 28 additions and 50 deletions
+16
View File
@@ -65,6 +65,22 @@ pub class Module {
self.children.push(new Module(child_name, child_path, child_output));
}
}
pub PathBuf output_dir(self*, PathBuf* parent_dir) {
if (self.path.is_dir() || Some("package.mist") == self.path.file_name().unwrap().to_str()) {
parent_dir.join(&self.name)
} else {
parent_dir.clone()
}
}
pub PathBuf output_path(self*, PathBuf* parent_dir) {
if (self.path.is_dir() || Some("package.mist") == self.path.file_name().unwrap().to_str()) {
parent_dir.join(&self.name).join("mod.rs")
} else {
parent_dir.join(&self.name).with_extension("rs")
}
}
}
pub Module master_package(PathBuf mist_path, PathBuf rust_path) {