MAINT: cargo fmt

This commit is contained in:
Jeremy Wall 2019-10-02 20:56:09 -05:00
parent acfd343c7a
commit acffc6d5da
2 changed files with 20 additions and 12 deletions

View File

@ -20,7 +20,12 @@ fn generate_rust_module() -> String {
let fixed_path_str = path_str.replace(std::path::MAIN_SEPARATOR, "/"); let fixed_path_str = path_str.replace(std::path::MAIN_SEPARATOR, "/");
if path.is_file() && !path_str.ends_with("_test.ucg") { if path.is_file() && !path_str.ends_with("_test.ucg") {
println!("Adding lib file: {}", path_str); println!("Adding lib file: {}", path_str);
let out_path = PathBuf::from(format!("{}{}{}", out_dir, std::path::MAIN_SEPARATOR, path_str)); let out_path = PathBuf::from(format!(
"{}{}{}",
out_dir,
std::path::MAIN_SEPARATOR,
path_str
));
// We have to copy the file into out out directory to ensure that we // We have to copy the file into out out directory to ensure that we
// have a reliable way for the stdlib.rs module file to include them // have a reliable way for the stdlib.rs module file to include them
// from. // from.
@ -28,7 +33,10 @@ fn generate_rust_module() -> String {
std::fs::copy(&path_str, &out_path).unwrap(); std::fs::copy(&path_str, &out_path).unwrap();
let include = format!( let include = format!(
"\tstdlib.insert(\n\t\tr\"{}\".to_string(),\n\t\tinclude_str!(r\"{}{}{}\"));\n", "\tstdlib.insert(\n\t\tr\"{}\".to_string(),\n\t\tinclude_str!(r\"{}{}{}\"));\n",
fixed_path_str, out_dir, std::path::MAIN_SEPARATOR, path_str fixed_path_str,
out_dir,
std::path::MAIN_SEPARATOR,
path_str
); );
rust_lib.push_str(&include); rust_lib.push_str(&include);
rust_lib.push_str("\n"); rust_lib.push_str("\n");