From 6e0fcde08d109997f02f83d85f98d018b00c5f07 Mon Sep 17 00:00:00 2001 From: qkzk Date: Mon, 7 Nov 2022 14:06:33 +0100 Subject: readme. Propagate write errors to caller --- src/git.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/git.rs') diff --git a/src/git.rs b/src/git.rs index 8dbbe74..8e121d8 100644 --- a/src/git.rs +++ b/src/git.rs @@ -4,7 +4,7 @@ use std::error::Error; use std::fmt::Write as _; -use std::path::PathBuf; +use std::path::Path; use std::process; struct GitStatus { @@ -73,7 +73,7 @@ fn parse_porcelain2(data: String) -> Option { Some(status) } -pub fn git(path: PathBuf) -> Result> { +pub fn git(path: &Path) -> Result> { if std::env::set_current_dir(&path).is_err() { // The path may not exist. It should never happen. return Ok("".to_owned()); -- cgit v1.2.3