From a51b2603f993dd02275d275d37bbd0a0f24dbe33 Mon Sep 17 00:00:00 2001 From: Aleksey Kladov Date: Mon, 17 Feb 2020 18:02:59 +0100 Subject: Stronger Types --- crates/ra_cli/src/main.rs | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'crates/ra_cli/src') diff --git a/crates/ra_cli/src/main.rs b/crates/ra_cli/src/main.rs index 7479fbd80..42f0b3e17 100644 --- a/crates/ra_cli/src/main.rs +++ b/crates/ra_cli/src/main.rs @@ -5,7 +5,7 @@ mod analysis_stats; mod analysis_bench; mod progress_report; -use std::{error::Error, fmt::Write, io::Read}; +use std::{error::Error, fmt::Write, io::Read, path::PathBuf}; use pico_args::Arguments; use ra_ide::{file_structure, Analysis}; @@ -60,11 +60,11 @@ enum Command { memory_usage: bool, only: Option, with_deps: bool, - path: String, + path: PathBuf, }, Bench { verbose: bool, - path: String, + path: PathBuf, op: analysis_bench::Op, }, HelpPrinted, @@ -180,7 +180,7 @@ ARGS: if trailing.len() != 1 { Err("Invalid flags")?; } - trailing.pop().unwrap() + trailing.pop().unwrap().into() }; Command::Stats { verbosity, randomize, memory_usage, only, with_deps, path } @@ -209,7 +209,7 @@ ARGS: } let verbose = matches.contains(["-v", "--verbose"]); - let path: String = matches.opt_value_from_str("--path")?.unwrap_or_default(); + let path: PathBuf = matches.opt_value_from_str("--path")?.unwrap_or_default(); let highlight_path: Option = matches.opt_value_from_str("--highlight")?; let complete_path: Option = matches.opt_value_from_str("--complete")?; let goto_def_path: Option = matches.opt_value_from_str("--goto-def")?; -- cgit v1.2.3