diff options
| author | Weicao-CatilGrass <1992414357@qq.com> | 2026-05-31 02:42:52 +0800 |
|---|---|---|
| committer | 魏曹先生 <1992414357@qq.com> | 2026-05-31 17:19:20 +0800 |
| commit | 2aa7bda3cb21ce6c052b82e08bcab79a625d04f2 (patch) | |
| tree | f10b89007fc67ca1a948f34abe6869b49296b932 /mingling_core/src/builds/comp.rs | |
| parent | 3aa409a55e4f2f0ab41b0949cc06eb13c2da4a43 (diff) | |
Enhance code quality across the entire codebase
Diffstat (limited to 'mingling_core/src/builds/comp.rs')
| -rw-r--r-- | mingling_core/src/builds/comp.rs | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/mingling_core/src/builds/comp.rs b/mingling_core/src/builds/comp.rs index 8b884c8..aa08627 100644 --- a/mingling_core/src/builds/comp.rs +++ b/mingling_core/src/builds/comp.rs @@ -10,7 +10,7 @@ const TMPL_COMP_FISH: &str = include_str!("../../tmpls/comps/fish.fish"); const TMPL_COMP_PWSH: &str = include_str!("../../tmpls/comps/pwsh.ps1"); /// Generate shell completion scripts for a given binary name. -/// On Windows, generates PowerShell completion. +/// On Windows, generates `PowerShell` completion. /// On Linux, generates Zsh, Bash, and Fish completions. /// Scripts are written to the `OUT_DIR` (or `target/` if `OUT_DIR` is not set). /// @@ -63,7 +63,7 @@ pub fn build_comp_scripts(name: &str) -> Result<(), std::io::Error> { /// ``` pub fn build_comp_script(shell_flag: &ShellFlag, bin_name: &str) -> Result<(), std::io::Error> { let out_dir = std::path::PathBuf::from(std::env::var("OUT_DIR").unwrap()); - let target_dir = out_dir.join("../../../").to_path_buf(); + let target_dir = out_dir.join("../../../").clone(); build_comp_script_to(shell_flag, bin_name, &target_dir.to_string_lossy()) } @@ -89,7 +89,7 @@ pub fn build_comp_script_to( tmpl_param!(tmpl, bin_name = bin_name); let target_path = std::path::PathBuf::from(target_dir); std::fs::create_dir_all(&target_path)?; - let output_path = target_path.join(format!("{}_comp{}", bin_name, ext)); + let output_path = target_path.join(format!("{bin_name}_comp{ext}")); std::fs::write(&output_path, tmpl.to_string()) } |
