You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
69 lines
2.1 KiB
69 lines
2.1 KiB
From c66f7857e36102cdb7a2518650d5053b7d55e467 Mon Sep 17 00:00:00 2001
|
|
From: Andrew Gallant <jamslam@gmail.com>
|
|
Date: Sun, 29 Jul 2018 09:40:38 -0400
|
|
Subject: [PATCH 1/2] tests/style: 80 columns, dammit
|
|
|
|
(cherry picked from commit 7c412bb2fa343a8d54090ea175c851cd822d8f62)
|
|
---
|
|
tests/workdir.rs | 23 +++++++++++++++++++----
|
|
1 file changed, 19 insertions(+), 4 deletions(-)
|
|
|
|
diff --git a/tests/workdir.rs b/tests/workdir.rs
|
|
index 3c47e94..a78f70d 100644
|
|
--- a/tests/workdir.rs
|
|
+++ b/tests/workdir.rs
|
|
@@ -49,7 +49,11 @@ impl WorkDir {
|
|
|
|
/// Try to create a new file with the given name and contents in this
|
|
/// directory.
|
|
- pub fn try_create<P: AsRef<Path>>(&self, name: P, contents: &str) -> io::Result<()> {
|
|
+ pub fn try_create<P: AsRef<Path>>(
|
|
+ &self,
|
|
+ name: P,
|
|
+ contents: &str,
|
|
+ ) -> io::Result<()> {
|
|
let path = self.dir.join(name);
|
|
self.try_create_bytes(path, contents.as_bytes())
|
|
}
|
|
@@ -70,7 +74,11 @@ impl WorkDir {
|
|
|
|
/// Try to create a new file with the given name and contents in this
|
|
/// directory.
|
|
- fn try_create_bytes<P: AsRef<Path>>(&self, path: P, contents: &[u8]) -> io::Result<()> {
|
|
+ fn try_create_bytes<P: AsRef<Path>>(
|
|
+ &self,
|
|
+ path: P,
|
|
+ contents: &[u8],
|
|
+ ) -> io::Result<()> {
|
|
let mut file = File::create(&path)?;
|
|
file.write_all(contents)?;
|
|
file.flush()
|
|
@@ -190,7 +198,11 @@ impl WorkDir {
|
|
match stdout.parse() {
|
|
Ok(t) => t,
|
|
Err(err) => {
|
|
- panic!("could not convert from string: {:?}\n\n{}", err, stdout);
|
|
+ panic!(
|
|
+ "could not convert from string: {:?}\n\n{}",
|
|
+ err,
|
|
+ stdout
|
|
+ );
|
|
}
|
|
}
|
|
}
|
|
@@ -221,7 +233,10 @@ impl WorkDir {
|
|
write!(stdin, "{}", input)
|
|
});
|
|
|
|
- let output = self.expect_success(cmd, child.wait_with_output().unwrap());
|
|
+ let output = self.expect_success(
|
|
+ cmd,
|
|
+ child.wait_with_output().unwrap(),
|
|
+ );
|
|
worker.join().unwrap().unwrap();
|
|
output
|
|
}
|
|
--
|
|
2.18.0
|
|
|