Skip to content

Commit 759e0d4

Browse files
committed
chore: Format
1 parent 82220c8 commit 759e0d4

File tree

6 files changed

+17
-20
lines changed

6 files changed

+17
-20
lines changed

src/fixture/child.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,4 +84,3 @@ impl ChildPath {
8484
&self.path
8585
}
8686
}
87-

src/fixture/dir.rs

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -89,8 +89,7 @@ impl TempDir {
8989
/// tmp_dir.close().unwrap();
9090
/// ```
9191
pub fn new() -> Result<Self, FixtureError> {
92-
let temp = tempfile::TempDir::new()
93-
.chain(FixtureError::new(FixtureKind::CreateDir))?;
92+
let temp = tempfile::TempDir::new().chain(FixtureError::new(FixtureKind::CreateDir))?;
9493
let temp = Inner::Temp(temp);
9594
Ok(Self { temp })
9695
}
@@ -108,7 +107,7 @@ impl TempDir {
108107
/// tmp_dir.close().unwrap();
109108
/// ```
110109
pub fn persist_if(self, yes: bool) -> Self {
111-
if ! yes {
110+
if !yes {
112111
return self;
113112
}
114113

@@ -170,9 +169,9 @@ impl TempDir {
170169
/// ```
171170
pub fn close(self) -> Result<(), FixtureError> {
172171
match self.temp {
173-
Inner::Temp(temp) =>
174-
temp.close()
175-
.chain(FixtureError::new(FixtureKind::Cleanup))?,
172+
Inner::Temp(temp) => temp
173+
.close()
174+
.chain(FixtureError::new(FixtureKind::Cleanup))?,
176175
Inner::Persisted(_) => (),
177176
}
178177
Ok(())

src/fixture/file.rs

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -91,10 +91,9 @@ impl NamedTempFile {
9191
/// ```
9292
pub fn new<S>(name: S) -> Result<Self, FixtureError>
9393
where
94-
S: AsRef<ffi::OsStr>
94+
S: AsRef<ffi::OsStr>,
9595
{
96-
let temp = tempfile::TempDir::new()
97-
.chain(FixtureError::new(FixtureKind::CreateDir))?;
96+
let temp = tempfile::TempDir::new().chain(FixtureError::new(FixtureKind::CreateDir))?;
9897
let path = temp.path().join(name.as_ref());
9998
let temp = Inner::Temp(temp);
10099
Ok(Self { temp, path })
@@ -113,7 +112,7 @@ impl NamedTempFile {
113112
/// tmp_file.close().unwrap();
114113
/// ```
115114
pub fn persist_if(mut self, yes: bool) -> Self {
116-
if ! yes {
115+
if !yes {
117116
return self;
118117
}
119118

@@ -171,9 +170,9 @@ impl NamedTempFile {
171170
/// ```
172171
pub fn close(self) -> Result<(), FixtureError> {
173172
match self.temp {
174-
Inner::Temp(temp) =>
175-
temp.close()
176-
.chain(FixtureError::new(FixtureKind::Cleanup))?,
173+
Inner::Temp(temp) => temp
174+
.close()
175+
.chain(FixtureError::new(FixtureKind::Cleanup))?,
177176
Inner::Persisted => (),
178177
}
179178
Ok(())

src/fixture/mod.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
//! Initialize the filesystem to use as test fixtures.
22
3+
mod child;
34
mod dir;
4-
mod file;
55
mod errors;
6+
mod file;
67
mod tools;
7-
mod child;
88

9-
pub use self::errors::*;
10-
pub use self::tools::*;
119
pub use self::child::*;
1210
pub use self::dir::*;
11+
pub use self::errors::*;
1312
pub use self::file::*;
13+
pub use self::tools::*;

src/fixture/tools.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,8 @@ use globwalk;
99

1010
use super::errors::*;
1111
use super::ChildPath;
12-
use super::TempDir;
1312
use super::NamedTempFile;
13+
use super::TempDir;
1414

1515
/// Create empty directories at [`ChildPath`].
1616
///

src/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,11 +77,11 @@ pub use fixture::TempDir;
7777
/// Extension traits that are useful to have available.
7878
pub mod prelude {
7979
pub use assert::PathAssert;
80-
pub use fixture::PathCreateDir;
8180
pub use fixture::FileTouch;
8281
pub use fixture::FileWriteBin;
8382
pub use fixture::FileWriteFile;
8483
pub use fixture::FileWriteStr;
8584
pub use fixture::PathChild;
8685
pub use fixture::PathCopy;
86+
pub use fixture::PathCreateDir;
8787
}

0 commit comments

Comments
 (0)