Skip to content

Commit 414a98a

Browse files
committed
.
1 parent d15bb53 commit 414a98a

File tree

2 files changed

+4
-11
lines changed

2 files changed

+4
-11
lines changed

git-config/src/values.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ use std::{borrow::Cow, convert::TryFrom, fmt::Display, str::FromStr};
44

55
use nom::AsChar;
66
#[cfg(not(target_os = "windows"))]
7-
use pwd::{Passwd, PwdError};
7+
use pwd::Passwd;
88
use quick_error::quick_error;
99
#[cfg(feature = "serde")]
1010
use serde::{Serialize, Serializer};
@@ -371,7 +371,7 @@ impl Path<'_> {
371371
let (username, val) = val.split_at(i);
372372
let username = std::str::from_utf8(username)?;
373373
let home = Passwd::from_name(username)
374-
.map_err(|_| PathError::Pwd)
374+
.map_err(|_| PathError::Pwd)?
375375
.ok_or(PathError::Missing { what: "pwd user info" })?
376376
.dir;
377377
let mut expanded = home.as_bytes().to_owned();

git-features/src/path.rs

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -71,11 +71,7 @@ pub fn into_bytes<'a>(path: impl Into<Cow<'a, Path>>) -> Result<Cow<'a, [u8]>, U
7171
path.into_os_string().into_vec()
7272
};
7373
#[cfg(not(unix))]
74-
let p: Vec<_> = path
75-
.into_os_string()
76-
.into_string()
77-
.map_err(|_| Utf8Error)?
78-
.into();
74+
let p: Vec<_> = path.into_os_string().into_string().map_err(|_| Utf8Error)?.into();
7975
p
8076
}),
8177
Cow::Borrowed(path) => Cow::Borrowed({
@@ -85,10 +81,7 @@ pub fn into_bytes<'a>(path: impl Into<Cow<'a, Path>>) -> Result<Cow<'a, [u8]>, U
8581
path.as_os_str().as_bytes()
8682
};
8783
#[cfg(not(unix))]
88-
let p = path
89-
.to_str()
90-
.ok_or(Utf8Error)?
91-
.as_bytes();
84+
let p = path.to_str().ok_or(Utf8Error)?.as_bytes();
9285
p
9386
}),
9487
};

0 commit comments

Comments
 (0)