Skip to content

Commit

Permalink
Minor cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
UebelAndre committed Jun 30, 2021
1 parent 71e8282 commit ecba90a
Showing 1 changed file with 16 additions and 16 deletions.
32 changes: 16 additions & 16 deletions cargo/cargo_build_script_runner/bin.rs
Original file line number Diff line number Diff line change
Expand Up @@ -39,9 +39,9 @@ fn run_buildrs() -> Result<(), String> {
progname,
crate_links,
out_dir,
envfile,
flagfile,
linkflags,
env_file,
compile_flags_file,
link_flags_file,
output_dep_env_path,
stdout_path,
stderr_path,
Expand Down Expand Up @@ -136,10 +136,10 @@ fn run_buildrs() -> Result<(), String> {
})?;

write(
&envfile,
&env_file,
BuildScriptOutput::to_env(&buildrs_outputs, &exec_root.to_string_lossy()).as_bytes(),
)
.expect(&format!("Unable to write file {:?}", envfile));
.expect(&format!("Unable to write file {:?}", env_file));
write(
&output_dep_env_path,
BuildScriptOutput::to_dep_env(&buildrs_outputs, &crate_links, &exec_root.to_string_lossy())
Expand All @@ -156,10 +156,10 @@ fn run_buildrs() -> Result<(), String> {
link_flags,
} = BuildScriptOutput::to_flags(&buildrs_outputs, &exec_root.to_string_lossy());

write(&flagfile, compile_flags.as_bytes())
.expect(&format!("Unable to write file {:?}", flagfile));
write(&linkflags, link_flags.as_bytes())
.expect(&format!("Unable to write file {:?}", linkflags));
write(&compile_flags_file, compile_flags.as_bytes())
.expect(&format!("Unable to write file {:?}", compile_flags_file));
write(&link_flags_file, link_flags.as_bytes())
.expect(&format!("Unable to write file {:?}", link_flags_file));
Ok(())
}

Expand All @@ -169,8 +169,8 @@ struct Options {
crate_links: String,
out_dir: String,
env_file: String,
flag_file: String,
link_flags: String,
compile_flags_file: String,
link_flags_file: String,
output_dep_env_path: String,
stdout_path: String,
stderr_path: String,
Expand All @@ -188,8 +188,8 @@ fn parse_args() -> Result<Options, String> {
Some(crate_links),
Some(out_dir),
Some(env_file),
Some(flag_file),
Some(link_flags),
Some(compile_flags_file),
Some(link_flags_file),
Some(output_dep_env_path),
Some(stdout_path),
Some(stderr_path),
Expand All @@ -199,16 +199,16 @@ fn parse_args() -> Result<Options, String> {
crate_links,
out_dir,
env_file,
flag_file,
link_flags,
compile_flags_file,
link_flags_file,
output_dep_env_path,
stdout_path,
stderr_path,
input_dep_env_paths: args.collect(),
})
}
_ => {
Err("Usage: $0 progname crate_links out_dir env_file flag_file link_flags output_dep_env_path stdout_path stderr_path [arg1...argn]".to_owned())
Err("Usage: $0 progname crate_links out_dir env_file compile_flags_file link_flags_file output_dep_env_path stdout_path stderr_path input_dep_env_paths[arg1...argn]".to_owned())
}
}
}
Expand Down

0 comments on commit ecba90a

Please sign in to comment.