diff options
author | bors[bot] <bors[bot]@users.noreply.github.com> | 2019-06-16 20:58:33 +0100 |
---|---|---|
committer | bors[bot] <bors[bot]@users.noreply.github.com> | 2019-06-16 20:58:33 +0100 |
commit | 1541b2d689393221938d7cb935862f76395874e9 (patch) | |
tree | 5f9c9c4dc33f2ad7a1350ffb7b0459abcd7fbc41 /crates/ra_tools/src/main.rs | |
parent | 924d4d7ca8bce948b8cbb30ef6da17354e48bad3 (diff) | |
parent | d3e74bfd2c1f7dca2054e1cfdc7aa312c9d12c98 (diff) |
Merge #1409
1409: The Fall down of failures r=matklad a=mominul
:grin:
Replaced all the uses of `failure` crate with `std::error::Error`.
Closes #1400
Depends on rust-analyzer/teraron#1
Co-authored-by: Muhammad Mominul Huque <[email protected]>
Diffstat (limited to 'crates/ra_tools/src/main.rs')
-rw-r--r-- | crates/ra_tools/src/main.rs | 11 |
1 files changed, 4 insertions, 7 deletions
diff --git a/crates/ra_tools/src/main.rs b/crates/ra_tools/src/main.rs index 285071ea5..846e0223e 100644 --- a/crates/ra_tools/src/main.rs +++ b/crates/ra_tools/src/main.rs | |||
@@ -1,6 +1,5 @@ | |||
1 | use clap::{App, SubCommand}; | 1 | use clap::{App, SubCommand}; |
2 | use core::str; | 2 | use core::str; |
3 | use failure::bail; | ||
4 | use ra_tools::{ | 3 | use ra_tools::{ |
5 | generate, gen_tests, install_format_hook, run, run_with_output, run_rustfmt, | 4 | generate, gen_tests, install_format_hook, run, run_with_output, run_rustfmt, |
6 | Overwrite, Result, run_fuzzer, run_clippy, | 5 | Overwrite, Result, run_fuzzer, run_clippy, |
@@ -64,10 +63,8 @@ fn verify_installed_extensions() -> Result<()> { | |||
64 | run_with_output(r"code --list-extensions", ".")? | 63 | run_with_output(r"code --list-extensions", ".")? |
65 | }; | 64 | }; |
66 | if !str::from_utf8(&exts.stdout)?.contains("ra-lsp") { | 65 | if !str::from_utf8(&exts.stdout)?.contains("ra-lsp") { |
67 | bail!( | 66 | Err("Could not install the Visual Studio Code extension. Please make sure you \ |
68 | "Could not install the Visual Studio Code extension. Please make sure you \ | 67 | have at least NodeJS 10.x installed and try again.")?; |
69 | have at least NodeJS 10.x installed and try again." | ||
70 | ); | ||
71 | } | 68 | } |
72 | Ok(()) | 69 | Ok(()) |
73 | } | 70 | } |
@@ -79,7 +76,7 @@ fn fix_path_for_mac() -> Result<()> { | |||
79 | const ROOT_DIR: &str = ""; | 76 | const ROOT_DIR: &str = ""; |
80 | let home_dir = match env::var("HOME") { | 77 | let home_dir = match env::var("HOME") { |
81 | Ok(home) => home, | 78 | Ok(home) => home, |
82 | Err(e) => bail!("Failed getting HOME from environment with error: {}.", e), | 79 | Err(e) => Err(format!("Failed getting HOME from environment with error: {}.", e))?, |
83 | }; | 80 | }; |
84 | 81 | ||
85 | [ROOT_DIR, &home_dir] | 82 | [ROOT_DIR, &home_dir] |
@@ -93,7 +90,7 @@ fn fix_path_for_mac() -> Result<()> { | |||
93 | if !vscode_path.is_empty() { | 90 | if !vscode_path.is_empty() { |
94 | let vars = match env::var_os("PATH") { | 91 | let vars = match env::var_os("PATH") { |
95 | Some(path) => path, | 92 | Some(path) => path, |
96 | None => bail!("Could not get PATH variable from env."), | 93 | None => Err("Could not get PATH variable from env.")?, |
97 | }; | 94 | }; |
98 | 95 | ||
99 | let mut paths = env::split_paths(&vars).collect::<Vec<_>>(); | 96 | let mut paths = env::split_paths(&vars).collect::<Vec<_>>(); |