Skip to content
This repository has been archived by the owner on Dec 29, 2022. It is now read-only.

Commit

Permalink
Merge pull request #1207 from Xanewok/test_tooltip_dirs
Browse files Browse the repository at this point in the history
Use `home_dir` from `home` crate
  • Loading branch information
Xanewok authored Dec 21, 2018
2 parents 7ee3bb8 + e57fa84 commit 6723084
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
1 change: 1 addition & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ cargo_metadata = "0.6"
clippy_lints = { git = "https://github.com/rust-lang/rust-clippy", rev = "a3c77f6ad1c1c185e561e9cd7fdec7db569169d1", optional = true }
env_logger = "0.5"
failure = "0.1.1"
home = "0.3"
itertools = "0.7.3"
jsonrpc-core = "8.0.1"
languageserver-types = "0.51"
Expand Down
6 changes: 2 additions & 4 deletions src/actions/hover.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ use crate::config::FmtConfig;
use crate::lsp_data::*;
use crate::server::ResponseError;

use home;
use racer;
use rls_analysis::{Def, DefKind};
use rls_span::{Column, Row, Span, ZeroIndexed};
Expand Down Expand Up @@ -646,10 +647,7 @@ fn racer_match_to_def(ctx: &InitActionContext, m: &racer::Match) -> Option<Def>
let contextstr = if kind == DefKind::Mod {
use std::env;

let home = env::var("HOME")
.or_else(|_| env::var("USERPROFILE"))
.map(PathBuf::from)
.unwrap_or_default();
let home = home::home_dir().unwrap_or_default();
let rustup_home = env::var("RUSTUP_HOME")
.map(PathBuf::from)
.unwrap_or_else(|_| home.join(".rustup"));
Expand Down

0 comments on commit 6723084

Please sign in to comment.