diff options
author | Aleksey Kladov <aleksey.kladov@gmail.com> | 2021-03-02 11:15:49 +0300 |
---|---|---|
committer | David Peter <sharkdp@users.noreply.github.com> | 2021-03-07 14:59:10 +0100 |
commit | 35347c23109400e9694f073bf8fe901b3ca1d59f (patch) | |
tree | 1d1313e03286911342bdf94b3af0d09e78f81910 /src/diff.rs | |
parent | b489fc75c9e6f54ab0dd855351df4a33a109a493 (diff) |
Improve readability
Using `Path`s for paths expresses intent more clearly.
Diffstat (limited to 'src/diff.rs')
-rw-r--r-- | src/diff.rs | 3 |
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()?; |