Skip to content

Commit c037aec

Browse files
committed
refactor(cli/rustup-mode): merge duplicate match arms
1 parent 3071164 commit c037aec

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

src/cli/rustup_mode.rs

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1868,13 +1868,12 @@ fn output_completion_script(
18681868
);
18691869
}
18701870
CompletionCommand::Cargo => {
1871-
if let Shell::Zsh = shell {
1872-
writeln!(process.stdout().lock(), "#compdef cargo")?;
1873-
}
1874-
18751871
let script = match shell {
18761872
Shell::Bash => "/etc/bash_completion.d/cargo",
1877-
Shell::Zsh => "/share/zsh/site-functions/_cargo",
1873+
Shell::Zsh => {
1874+
writeln!(process.stdout().lock(), "#compdef cargo")?;
1875+
"/share/zsh/site-functions/_cargo"
1876+
}
18781877
_ => {
18791878
return Err(anyhow!(
18801879
"{command} does not currently support completions for {shell}",

0 commit comments

Comments
 (0)