Skip to content

Commit

Permalink
fix warning due to use of env::home_dir
Browse files Browse the repository at this point in the history
  • Loading branch information
Stebalien committed Jul 27, 2018
1 parent c01b2a7 commit 84cfdb5
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 4 deletions.
1 change: 1 addition & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ appveyor = { repository = "Stebalien/term" }

[dependencies]
byteorder = "1.2.1"
dirs = "1.0.2"

[target.'cfg(windows)'.dependencies]
winapi = { version = "0.3", features = ["wincon", "handleapi", "fileapi"] }
Expand Down
10 changes: 7 additions & 3 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -56,13 +56,17 @@
//! [win]: http://msdn.microsoft.com/en-us/library/windows/desktop/ms682010%28v=vs.85%29.aspx
//! [ti]: https://en.wikipedia.org/wiki/Terminfo
#![doc(html_logo_url = "https://www.rust-lang.org/logos/rust-logo-128x128-blk-v2.png",
html_favicon_url = "https://doc.rust-lang.org/favicon.ico",
html_root_url = "https://stebalien.github.io/doc/term/term/", test(attr(deny(warnings))))]
#![doc(
html_logo_url = "https://www.rust-lang.org/logos/rust-logo-128x128-blk-v2.png",
html_favicon_url = "https://doc.rust-lang.org/favicon.ico",
html_root_url = "https://stebalien.github.io/doc/term/term/",
test(attr(deny(warnings)))
)]
#![deny(missing_docs)]
#![cfg_attr(test, deny(warnings))]

extern crate byteorder;
extern crate dirs;

use std::io::prelude::*;

Expand Down
4 changes: 3 additions & 1 deletion src/terminfo/searcher.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@ use std::env;
use std::fs;
use std::path::PathBuf;

use dirs;

/// Return path to database entry for `term`
pub fn get_dbpath_for_term(term: &str) -> Option<PathBuf> {
let mut dirs_to_search = Vec::new();
Expand Down Expand Up @@ -56,7 +58,7 @@ pub fn get_dbpath_for_term(term: &str) -> Option<PathBuf> {
// ~/.terminfo, ncurses will search /etc/terminfo, then
// /lib/terminfo, and eventually /usr/share/terminfo.
// On Haiku the database can be found at /boot/system/data/terminfo
if let Some(mut homedir) = env::home_dir() {
if let Some(mut homedir) = dirs::home_dir() {
homedir.push(".terminfo");
dirs_to_search.push(homedir)
}
Expand Down

0 comments on commit 84cfdb5

Please sign in to comment.