summaryrefslogtreecommitdiffstats
path: root/src/utils.rs
diff options
context:
space:
mode:
authorNick Young <nick@nickwb.net>2019-09-06 02:45:04 +1000
committerMatan Kushner <hello@matchai.me>2019-09-05 12:45:04 -0400
commiteb724279da21feca8438a40249d1b2d47e8ca312 (patch)
treede4642c75b612b0bc817905cf90e711846c3eee5 /src/utils.rs
parent4f17bae3157d8ddd82af7c630f5ba65de0e8cb90 (diff)
feat: Adds Git State module for showing "REBASING 2/3", etc. (#276)
- Adds the git_state module. - Adds git_state to the default prompt order - Updates the documentation to describe the git_state module
Diffstat (limited to 'src/utils.rs')
-rw-r--r--src/utils.rs3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/utils.rs b/src/utils.rs
index 4a0337ae6..c873f45aa 100644
--- a/src/utils.rs
+++ b/src/utils.rs
@@ -1,8 +1,9 @@
use std::fs::File;
use std::io::{Read, Result};
+use std::path::Path;
/// Return the string contents of a file
-pub fn read_file(file_name: &str) -> Result<String> {
+pub fn read_file<P: AsRef<Path>>(file_name: P) -> Result<String> {
let mut file = File::open(file_name)?;
let mut data = String::new();