Skip to content

Commit dc0bc58

Browse files
sstanglweihanglo
andauthored
Update src/bin/cargo/commands/help.rs
Co-authored-by: Weihang Lo <[email protected]>
1 parent e77b254 commit dc0bc58

File tree

1 file changed

+2
-5
lines changed

1 file changed

+2
-5
lines changed

src/bin/cargo/commands/help.rs

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -94,11 +94,8 @@ fn check_alias(config: &Config, subcommand: &str) -> Option<Vec<String>> {
9494
/// Checks if the given subcommand is a built-in command (not via an alias).
9595
///
9696
/// Returns None if it is not a built-in command.
97-
fn check_builtin(subcommand: &str) -> Option<String> {
98-
match super::builtin_exec(subcommand) {
99-
Some(_) => Some(subcommand.to_string()),
100-
None => None,
101-
}
97+
fn check_builtin(subcommand: &str) -> Option<&str> {
98+
super::builtin_exec(subcommand).map(|_| subcommand)
10299
}
103100

104101
/// Extracts the given man page from the compressed archive.

0 commit comments

Comments
 (0)