Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor: clean up unwrap and clone #17282

Merged
merged 6 commits into from
Jan 15, 2023
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
clippy
  • Loading branch information
attila-lin committed Jan 6, 2023
commit 94ec91d1917ce0c9da89d89e0db833ca5dca96ad
10 changes: 2 additions & 8 deletions cli/args/flags.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2574,10 +2574,7 @@ fn info_parse(flags: &mut Flags, matches: &clap::ArgMatches) {
fn install_parse(flags: &mut Flags, matches: &clap::ArgMatches) {
runtime_args_parse(flags, matches, true, true);

let root = match matches.value_of("root") {
Some(install_root) => Some(PathBuf::from(install_root)),
None => None,
};
let root = matches.value_of("root").map(PathBuf::from);

let force = matches.is_present("force");
let name = matches.value_of("name").map(|s| s.to_string());
Expand All @@ -2600,10 +2597,7 @@ fn install_parse(flags: &mut Flags, matches: &clap::ArgMatches) {
}

fn uninstall_parse(flags: &mut Flags, matches: &clap::ArgMatches) {
let root = match matches.value_of("root") {
Some(install_root) => Some(PathBuf::from(install_root)),
None => None,
};
let root = matches.value_of("root").map(PathBuf::from);

let name = matches.value_of("name").unwrap().to_string();
flags.subcommand = DenoSubcommand::Uninstall(UninstallFlags { name, root });
Expand Down