Optimised main.mist
This commit is contained in:
+4
-7
@@ -15,7 +15,6 @@ void main() {
|
||||
|
||||
match (args[1].as_str()) {
|
||||
"run" | "build" | "check" | "r" | "b" | "c" => {
|
||||
|
||||
var root = transpiler::build();
|
||||
|
||||
println!("");
|
||||
@@ -97,13 +96,11 @@ void init_project(Vec<String> mut args) {
|
||||
void inject_mist_target(bool is_lib) {
|
||||
String toml_content = fs::read_to_string("Cargo.toml").expect("Failed to read Cargo.toml");
|
||||
|
||||
str* inject;
|
||||
|
||||
if (is_lib) {
|
||||
inject = "\n[lib]\nname = \"my_lib\"\npath = \".mist/src/lib.rs\"\n";
|
||||
str* inject = if (is_lib) {
|
||||
"\n[lib]\nname = \"my_lib\"\npath = \".mist/src/lib.rs\"\n"
|
||||
} else {
|
||||
inject = "\n[[bin]]\nname = \"my_bin\"\npath = \".mist/src/main.rs\"\n";
|
||||
}
|
||||
"\n[[bin]]\nname = \"my_bin\"\npath = \".mist/src/main.rs\"\n"
|
||||
};
|
||||
|
||||
fs::write("Cargo.toml", toml_content+inject).expect("Failed to create src/main.mist");
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user