Skip to content

Commit 114bdc7

Browse files
committed
Fix warnings in test
1 parent 85aa218 commit 114bdc7

File tree

1 file changed

+4
-7
lines changed

1 file changed

+4
-7
lines changed

tests/parse_and_replace.rs

+4-7
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ use std::collections::HashSet;
1515
use std::ffi::OsString;
1616
use std::path::{Path, PathBuf};
1717
use std::process::Output;
18-
use std::{env, fs};
18+
use std::fs;
1919

2020
use failure::{Error, ResultExt};
2121
use tempdir::TempDir;
@@ -32,9 +32,6 @@ mod settings {
3232
pub const CHECK_JSON: &str = "RUSTFIX_TEST_CHECK_JSON";
3333
pub const RECORD_JSON: &str = "RUSTFIX_TEST_RECORD_JSON";
3434
pub const RECORD_FIXED_RUST: &str = "RUSTFIX_TEST_RECORD_FIXED_RUST";
35-
36-
// set automatically
37-
pub const MODE: &str = "RUSTFIX_MODE";
3835
}
3936

4037
fn compile(file: &Path, mode: &str) -> Result<Output, Error> {
@@ -125,15 +122,15 @@ fn diff(expected: &str, actual: &str) -> String {
125122
write!(
126123
&mut res,
127124
"differences found (+ == actual, - == expected):\n"
128-
);
125+
).unwrap();
129126
different = true;
130127
}
131128
for diff in diff.lines() {
132-
writeln!(&mut res, "{} {}", prefix, diff);
129+
writeln!(&mut res, "{} {}", prefix, diff).unwrap();
133130
}
134131
}
135132
if different {
136-
write!(&mut res, "");
133+
write!(&mut res, "").unwrap();
137134
}
138135

139136
res

0 commit comments

Comments
 (0)