about summary refs log tree commit diff
diff options
context:
space:
mode:
authorPhilipp Hansch <dev@phansch.net>2018-10-16 20:58:00 +0200
committerPhilipp Hansch <dev@phansch.net>2018-10-16 20:58:00 +0200
commit05ffc2d05743c0cc4ad5e551c147dc8385e67bac (patch)
tree8d756cadee0bdf40ad6ce6dce6b8f0095b911889
parent956987f43e3012c3487973cc0dd47f7c4eaa7942 (diff)
downloadrust-05ffc2d05743c0cc4ad5e551c147dc8385e67bac.tar.gz
rust-05ffc2d05743c0cc4ad5e551c147dc8385e67bac.zip
Fix dogfood
`expect_fun_call` causes a false-positive, so I disabled it for now.
-rw-r--r--clippy_dev/src/lib.rs3
1 files changed, 2 insertions, 1 deletions
diff --git a/clippy_dev/src/lib.rs b/clippy_dev/src/lib.rs
index 1c303d180d2..dcb2de2b1f8 100644
--- a/clippy_dev/src/lib.rs
+++ b/clippy_dev/src/lib.rs
@@ -106,6 +106,7 @@ fn lint_files() -> impl Iterator<Item=walkdir::DirEntry> {
 /// `path` is the relative path to the file on which you want to perform the replacement.
 ///
 /// See `replace_region_in_text` for documentation of the other options.
+#[allow(clippy::expect_fun_call)]
 pub fn replace_region_in_file<F>(path: &str, start: &str, end: &str, replace_start: bool, replacements: F) where F: Fn() -> Vec<String> {
     let mut f = fs::File::open(path).expect(&format!("File not found: {}", path));
     let mut contents = String::new();
@@ -116,7 +117,7 @@ pub fn replace_region_in_file<F>(path: &str, start: &str, end: &str, replace_sta
     f.write_all(replaced.as_bytes()).expect("Unable to write file");
     // Ensure we write the changes with a trailing newline so that
     // the file has the proper line endings.
-    f.write(b"\n").expect("Unable to write file");
+    f.write_all(b"\n").expect("Unable to write file");
 }
 
 /// Replace a region in a text delimited by two lines matching regexes.