summaryrefslogtreecommitdiffstats
path: root/src/diff.rs
diff options
context:
space:
mode:
authorAleksey Kladov <aleksey.kladov@gmail.com>2021-03-02 11:15:49 +0300
committerDavid Peter <sharkdp@users.noreply.github.com>2021-03-07 14:59:10 +0100
commit35347c23109400e9694f073bf8fe901b3ca1d59f (patch)
tree1d1313e03286911342bdf94b3af0d09e78f81910 /src/diff.rs
parentb489fc75c9e6f54ab0dd855351df4a33a109a493 (diff)
Improve readability
Using `Path`s for paths expresses intent more clearly.
Diffstat (limited to 'src/diff.rs')
-rw-r--r--src/diff.rs3
1 files changed, 1 insertions, 2 deletions
diff --git a/src/diff.rs b/src/diff.rs
index bd08468a..1aaca4f4 100644
--- a/src/diff.rs
+++ b/src/diff.rs
@@ -1,7 +1,6 @@
#![cfg(feature = "git")]
use std::collections::HashMap;
-use std::ffi::OsStr;
use std::fs;
use std::path::Path;
@@ -17,7 +16,7 @@ pub enum LineChange {
pub type LineChanges = HashMap<u32, LineChange>;
-pub fn get_git_diff(filename: &OsStr) -> Option<LineChanges> {
+pub fn get_git_diff(filename: &Path) -> Option<LineChanges> {
let repo = Repository::discover(&filename).ok()?;
let repo_path_absolute = fs::canonicalize(repo.workdir()?).ok()?;