Skip to content

Commit 05ffc2d

Browse files
committed
Fix dogfood
`expect_fun_call` causes a false-positive, so I disabled it for now.
1 parent 956987f commit 05ffc2d

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

clippy_dev/src/lib.rs

+2-1
Original file line numberDiff line numberDiff line change
@@ -106,6 +106,7 @@ fn lint_files() -> impl Iterator<Item=walkdir::DirEntry> {
106106
/// `path` is the relative path to the file on which you want to perform the replacement.
107107
///
108108
/// See `replace_region_in_text` for documentation of the other options.
109+
#[allow(clippy::expect_fun_call)]
109110
pub fn replace_region_in_file<F>(path: &str, start: &str, end: &str, replace_start: bool, replacements: F) where F: Fn() -> Vec<String> {
110111
let mut f = fs::File::open(path).expect(&format!("File not found: {}", path));
111112
let mut contents = String::new();
@@ -116,7 +117,7 @@ pub fn replace_region_in_file<F>(path: &str, start: &str, end: &str, replace_sta
116117
f.write_all(replaced.as_bytes()).expect("Unable to write file");
117118
// Ensure we write the changes with a trailing newline so that
118119
// the file has the proper line endings.
119-
f.write(b"\n").expect("Unable to write file");
120+
f.write_all(b"\n").expect("Unable to write file");
120121
}
121122

122123
/// Replace a region in a text delimited by two lines matching regexes.

0 commit comments

Comments
 (0)