diff options
author | Nayeem Rahman <muhammed.9939@gmail.com> | 2020-02-11 09:29:36 +0000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-02-11 10:29:36 +0100 |
commit | 701ce9b3342647cf01cb23c4fc28bc99ce0aa8c1 (patch) | |
tree | e7e36d47453f8f2fe16027ed54d37fee75b153dc /cli/lib.rs | |
parent | 79b3bc05d6de520f1df73face1744ae3d8be0bb8 (diff) |
refactor: Use PathBuf for paths in flag parsing and whitelists (#3955)
* Use PathBuf for DenoSubcommand::Bundle's out_file
* Use PathBuf for DenoSubcommand::Format's files
* Use PathBuf for DenoSubcommand::Install's dir
* Use PathBuf for read/write whitelists
Diffstat (limited to 'cli/lib.rs')
-rw-r--r-- | cli/lib.rs | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/cli/lib.rs b/cli/lib.rs index 4e100127b..f6d12d21d 100644 --- a/cli/lib.rs +++ b/cli/lib.rs @@ -72,6 +72,7 @@ use log::Level; use log::Metadata; use log::Record; use std::env; +use std::path::PathBuf; static LOGGER: Logger = Logger; @@ -258,7 +259,7 @@ async fn info_command(flags: DenoFlags, file: Option<String>) { async fn install_command( flags: DenoFlags, - dir: Option<String>, + dir: Option<PathBuf>, exe_name: String, module_url: String, args: Vec<String>, @@ -331,7 +332,7 @@ async fn eval_command(flags: DenoFlags, code: String) { async fn bundle_command( flags: DenoFlags, source_file: String, - out_file: Option<String>, + out_file: Option<PathBuf>, ) { debug!(">>>>> bundle_async START"); let source_file_specifier = @@ -404,7 +405,7 @@ async fn run_script(flags: DenoFlags, script: String) { js_check(worker.execute("window.dispatchEvent(new Event('unload'))")); } -async fn fmt_command(files: Option<Vec<String>>, check: bool) { +async fn fmt_command(files: Option<Vec<PathBuf>>, check: bool) { if let Err(err) = fmt::format_files(files, check) { print_err_and_exit(err); } |