From 84cfdb51775b327fedf21784749d862fdffa10b4 Mon Sep 17 00:00:00 2001 From: Steven Allen Date: Fri, 27 Jul 2018 16:30:29 -0700 Subject: [PATCH] fix warning due to use of env::home_dir --- src/lib.rs | 10 +++++++--- src/terminfo/searcher.rs | 4 +++- 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/src/lib.rs b/src/lib.rs index d8c1e7a64210..f28699d77d52 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -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::*; diff --git a/src/terminfo/searcher.rs b/src/terminfo/searcher.rs index 76865748db6d..27eabaa38648 100644 --- a/src/terminfo/searcher.rs +++ b/src/terminfo/searcher.rs @@ -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 { let mut dirs_to_search = Vec::new(); @@ -56,7 +58,7 @@ pub fn get_dbpath_for_term(term: &str) -> Option { // ~/.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) } -- 2.17.1