Skip to content

Commit

Permalink
Fix dogfood
Browse files Browse the repository at this point in the history
`expect_fun_call` causes a false-positive, so I disabled it for now.
  • Loading branch information
phansch committed Oct 16, 2018
1 parent 956987f commit 05ffc2d
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion clippy_dev/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand All @@ -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.
Expand Down

0 comments on commit 05ffc2d

Please sign in to comment.