Fix dogfood

`expect_fun_call` causes a false-positive, so I disabled it for now.
This commit is contained in:
Philipp Hansch 2018-10-16 20:58:00 +02:00
parent 956987f43e
commit 05ffc2d057
No known key found for this signature in database
GPG key ID: B6FA06A6E0E2665B

View file

@ -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.