diff options
author | Bert Belder <bertbelder@gmail.com> | 2021-01-12 04:55:09 -0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-01-12 13:55:09 +0100 |
commit | de0ae3a12c470623c9a3acfde8e36171e29cb6ef (patch) | |
tree | e9e3dd2f87813bdf016dd3b599ad5d3d44cf7481 | |
parent | fd56fa89f36016a816450cd0e8df5853c66d170c (diff) |
fix(installer): remove redundant clone (#9098)
-rw-r--r-- | cli/tools/installer.rs | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/cli/tools/installer.rs b/cli/tools/installer.rs index 4f8801f09..643240474 100644 --- a/cli/tools/installer.rs +++ b/cli/tools/installer.rs @@ -48,7 +48,7 @@ fn validate_name(exec_name: &str) -> Result<(), AnyError> { /// A second compatible with git bash / MINGW64 /// Generate batch script to satisfy that. fn generate_executable_file( - file_path: PathBuf, + mut file_path: PathBuf, args: Vec<String>, ) -> Result<(), AnyError> { let args: Vec<String> = args.iter().map(|c| format!("\"{}\"", c)).collect(); @@ -61,8 +61,7 @@ fn generate_executable_file( // write file for bash // create filepath without extensions - let mut copy_path = file_path.clone(); - copy_path.set_extension(""); + file_path.set_extension(""); let template = format!( r#"#!/bin/sh # generated by deno install @@ -70,7 +69,7 @@ deno {} "$@" "#, args.join(" "), ); - let mut file = File::create(©_path)?; + let mut file = File::create(&file_path)?; file.write_all(template.as_bytes())?; Ok(()) } |