Skip to content
Permalink
Browse files

fix warning due to use of env::home_dir

  • Loading branch information...
Stebalien committed Jul 27, 2018
1 parent c01b2a7 commit 84cfdb51775b327fedf21784749d862fdffa10b4
Showing with 11 additions and 4 deletions.
  1. +1 −0 Cargo.toml
  2. +7 −3 src/lib.rs
  3. +3 −1 src/terminfo/searcher.rs
@@ -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"] }
@@ -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::*;

@@ -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();
@@ -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)
}

0 comments on commit 84cfdb5

Please sign in to comment.
You can’t perform that action at this time.