Skip to content

Commit 0d38b83

Browse files
committed
path support for ~
1 parent 8a0c77b commit 0d38b83

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

Cargo.toml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,4 +4,5 @@ version = "0.1.0"
44
authors = ["Dustin Knopoff <dustinknopoff@gmail.com>"]
55

66
[dependencies]
7-
colored = "1.6"
7+
colored = "1.6"
8+
dirs = "1.0.4"

src/main.rs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,7 @@
4444
//! These can be modifed in the code to your preference.
4545
//!
4646
extern crate colored;
47+
extern crate dirs;
4748

4849
use colored::*;
4950
use std::collections::HashMap;
@@ -181,7 +182,9 @@ impl AllDocs {
181182
///
182183
/// A final `Vec` of the collected comment strings is returned.
183184
pub fn get_info() -> Vec<Vec<String>> {
184-
let f = File::open("/Users/Dustin/.zshrc").unwrap();
185+
let mut p = dirs::home_dir().unwrap();
186+
p.push(".zshrc");
187+
let f = File::open(&p).unwrap();
185188
let f = BufReader::new(f);
186189
let mut result: Vec<Vec<String>> = Vec::new();
187190
result.push(Vec::new());

0 commit comments

Comments
 (0)