Skip to content

Commit f6d9693

Browse files
committed
Fix build (#331)
Always a good idea to run all tests beforehand.
1 parent 86aa7b3 commit f6d9693

File tree

2 files changed

+4
-5
lines changed

2 files changed

+4
-5
lines changed

Diff for: git-config/src/values.rs

+2-3
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22
33
use std::{borrow::Cow, convert::TryFrom, fmt::Display, str::FromStr};
44

5-
use nom::AsChar;
65
#[cfg(not(target_os = "windows"))]
76
use pwd::Passwd;
87
use quick_error::{quick_error, ResultExt};
@@ -381,13 +380,13 @@ impl<'a> Path<'a> {
381380
}
382381

383382
#[cfg(target_os = "windows")]
384-
fn interpolate_user(self) -> Result<Self, PathError> {
383+
fn interpolate_user(self) -> Result<Cow<'a, std::path::Path>, PathError> {
385384
Err(PathError::UserInterpolationUnsupported)
386385
}
387386

388387
#[cfg(not(target_os = "windows"))]
389388
fn interpolate_user(self) -> Result<Cow<'a, std::path::Path>, PathError> {
390-
let (_prefix, val) = self.split_at('/'.len());
389+
let (_prefix, val) = self.split_at("/".len());
391390
let i = val
392391
.iter()
393392
.position(|&e| e == b'/')

Diff for: git-worktree/src/lib.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ pub mod index {
8888
where
8989
Find: for<'a> FnMut(&oid, &'a mut Vec<u8>) -> Option<git_object::BlobRef<'a>>,
9090
{
91-
let dest = root.join(git_features::path::from_byte_slice(entry_path).ok_or_else(|| {
91+
let dest = root.join(git_features::path::from_byte_slice(entry_path).map_err(|_| {
9292
index::checkout::Error::IllformedUtf8 {
9393
path: entry_path.to_owned(),
9494
}
@@ -126,7 +126,7 @@ pub mod index {
126126
path: root.to_path_buf(),
127127
})?;
128128
let symlink_destination = git_features::path::from_byte_slice(obj.data)
129-
.ok_or_else(|| index::checkout::Error::IllformedUtf8 { path: obj.data.into() })?;
129+
.map_err(|_| index::checkout::Error::IllformedUtf8 { path: obj.data.into() })?;
130130
if symlinks {
131131
#[cfg(unix)]
132132
std::os::unix::fs::symlink(symlink_destination, &dest)?;

0 commit comments

Comments
 (0)