diff options
author | Aleksey Kladov <[email protected]> | 2020-02-17 17:02:59 +0000 |
---|---|---|
committer | Aleksey Kladov <[email protected]> | 2020-02-17 17:02:59 +0000 |
commit | a51b2603f993dd02275d275d37bbd0a0f24dbe33 (patch) | |
tree | c92a8ed1d3ca47f99a2c261f5f28c975ac669633 | |
parent | 017f0e4e53dfb1fb1b8a1844cf99b253dd9dbd25 (diff) |
Stronger Types
-rw-r--r-- | crates/ra_cli/src/main.rs | 10 |
1 files changed, 5 insertions, 5 deletions
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; | |||
5 | mod analysis_bench; | 5 | mod analysis_bench; |
6 | mod progress_report; | 6 | mod progress_report; |
7 | 7 | ||
8 | use std::{error::Error, fmt::Write, io::Read}; | 8 | use std::{error::Error, fmt::Write, io::Read, path::PathBuf}; |
9 | 9 | ||
10 | use pico_args::Arguments; | 10 | use pico_args::Arguments; |
11 | use ra_ide::{file_structure, Analysis}; | 11 | use ra_ide::{file_structure, Analysis}; |
@@ -60,11 +60,11 @@ enum Command { | |||
60 | memory_usage: bool, | 60 | memory_usage: bool, |
61 | only: Option<String>, | 61 | only: Option<String>, |
62 | with_deps: bool, | 62 | with_deps: bool, |
63 | path: String, | 63 | path: PathBuf, |
64 | }, | 64 | }, |
65 | Bench { | 65 | Bench { |
66 | verbose: bool, | 66 | verbose: bool, |
67 | path: String, | 67 | path: PathBuf, |
68 | op: analysis_bench::Op, | 68 | op: analysis_bench::Op, |
69 | }, | 69 | }, |
70 | HelpPrinted, | 70 | HelpPrinted, |
@@ -180,7 +180,7 @@ ARGS: | |||
180 | if trailing.len() != 1 { | 180 | if trailing.len() != 1 { |
181 | Err("Invalid flags")?; | 181 | Err("Invalid flags")?; |
182 | } | 182 | } |
183 | trailing.pop().unwrap() | 183 | trailing.pop().unwrap().into() |
184 | }; | 184 | }; |
185 | 185 | ||
186 | Command::Stats { verbosity, randomize, memory_usage, only, with_deps, path } | 186 | Command::Stats { verbosity, randomize, memory_usage, only, with_deps, path } |
@@ -209,7 +209,7 @@ ARGS: | |||
209 | } | 209 | } |
210 | 210 | ||
211 | let verbose = matches.contains(["-v", "--verbose"]); | 211 | let verbose = matches.contains(["-v", "--verbose"]); |
212 | let path: String = matches.opt_value_from_str("--path")?.unwrap_or_default(); | 212 | let path: PathBuf = matches.opt_value_from_str("--path")?.unwrap_or_default(); |
213 | let highlight_path: Option<String> = matches.opt_value_from_str("--highlight")?; | 213 | let highlight_path: Option<String> = matches.opt_value_from_str("--highlight")?; |
214 | let complete_path: Option<String> = matches.opt_value_from_str("--complete")?; | 214 | let complete_path: Option<String> = matches.opt_value_from_str("--complete")?; |
215 | let goto_def_path: Option<String> = matches.opt_value_from_str("--goto-def")?; | 215 | let goto_def_path: Option<String> = matches.opt_value_from_str("--goto-def")?; |