Skip to content

Commit 5fb6c41

Browse files
committed
make fmt; fix build
1 parent bb2d06e commit 5fb6c41

File tree

2 files changed

+14
-9
lines changed

2 files changed

+14
-9
lines changed

git-config/src/values.rs

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -276,12 +276,13 @@ impl Serialize for Value<'_> {
276276

277277
///
278278
pub mod path {
279-
use crate::values::Path;
279+
use std::borrow::Cow;
280+
280281
#[cfg(not(target_os = "windows"))]
281282
use pwd::Passwd;
282283
use quick_error::ResultExt;
283-
use std::borrow::Cow;
284-
use std::path::PathBuf;
284+
285+
use crate::values::Path;
285286

286287
pub mod interpolate {
287288
use quick_error::quick_error;
@@ -358,7 +359,7 @@ pub mod path {
358359

359360
#[cfg(target_os = "windows")]
360361
fn interpolate_user(self) -> Result<Cow<'a, std::path::Path>, interpolate::Error> {
361-
Err(interpolate::ErrorUserInterpolationUnsupported)
362+
Err(interpolate::Error::UserInterpolationUnsupported)
362363
}
363364

364365
#[cfg(not(target_os = "windows"))]
@@ -376,15 +377,16 @@ pub mod path {
376377
.dir;
377378
let path_past_user_prefix =
378379
git_features::path::from_byte_slice(&path_with_leading_slash[1..]).context("path past ~user/")?;
379-
Ok(PathBuf::from(home).join(path_past_user_prefix).into())
380+
Ok(std::path::PathBuf::from(home).join(path_past_user_prefix).into())
380381
}
381382
}
382383

383384
#[cfg(test)]
384385
mod tests {
385-
use crate::values::{path::interpolate::Error, Path};
386386
use std::borrow::Cow;
387387

388+
use crate::values::{path::interpolate::Error, Path};
389+
388390
#[test]
389391
fn not_interpolated() {
390392
let path = &b"/foo/bar"[..];
@@ -460,7 +462,7 @@ pub mod path {
460462
fn user_interpolated() {
461463
assert!(matches!(
462464
Path::from(Cow::Borrowed(&b"~baz/foo/bar"[..])).interpolate(None),
463-
Err(path::interpolate::ErrorUserInterpolationUnsupported)
465+
Err(path::interpolate::Error::UserInterpolationUnsupported)
464466
));
465467
}
466468

git-config/tests/integration_tests/file_integeration_test.rs

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
1-
use std::path::PathBuf;
2-
use std::{borrow::Cow, convert::TryFrom, path::Path};
1+
use std::{
2+
borrow::Cow,
3+
convert::TryFrom,
4+
path::{Path, PathBuf},
5+
};
36

47
use git_config::{file::GitConfig, values::*};
58

0 commit comments

Comments
 (0)