diff options
author | Canop <cano.petrole@gmail.com> | 2020-01-20 22:11:38 +0100 |
---|---|---|
committer | Canop <cano.petrole@gmail.com> | 2020-01-20 22:11:38 +0100 |
commit | ec5220711e02c63a4832f984ae788958b3133d18 (patch) | |
tree | 822dacfb3a6c34809291bbd37cac5c958691dc31 /src/cli.rs | |
parent | 7ccda47e5044ec2b56b1b6deb4ecdd82eacae9ff (diff) |
minor code fmt changes
Diffstat (limited to 'src/cli.rs')
-rw-r--r-- | src/cli.rs | 27 |
1 files changed, 10 insertions, 17 deletions
@@ -35,19 +35,18 @@ fn canonicalize_root(root: &Path) -> io::Result<PathBuf> { #[cfg(windows)] fn canonicalize_root(root: &Path) -> io::Result<PathBuf> { - Ok( - if root.is_relative() { - env::current_dir()?.join(root) - } else { - root.to_path_buf() - } - ) + Ok(if root.is_relative() { + env::current_dir()?.join(root) + } else { + root.to_path_buf() + }) } /// return the parsed launch arguments pub fn read_launch_args() -> Result<AppLaunchArgs, ProgramError> { let cli_args = crate::clap::clap_app().get_matches(); - let mut root = cli_args.value_of("root") + let mut root = cli_args + .value_of("root") .map_or(env::current_dir()?, PathBuf::from); if !root.exists() { Err(TreeBuildError::FileNotFound { @@ -84,15 +83,9 @@ pub fn read_launch_args() -> Result<AppLaunchArgs, ProgramError> { tree_options.respect_git_ignore = respect_ignore.parse()?; } let install = cli_args.is_present("install"); - let file_export_path = cli_args - .value_of("file_export_path") - .map(str::to_string); - let cmd_export_path = cli_args - .value_of("cmd_export_path") - .map(str::to_string); - let commands = cli_args - .value_of("commands") - .map(str::to_string); + let file_export_path = cli_args.value_of("file_export_path").map(str::to_string); + let cmd_export_path = cli_args.value_of("cmd_export_path").map(str::to_string); + let commands = cli_args.value_of("commands").map(str::to_string); let no_style = cli_args.is_present("no-style"); let height = cli_args.value_of("height").and_then(|s| s.parse().ok()); let print_shell_function = cli_args |