Unnamed repository; edit this file 'description' to name the repository.
Diffstat (limited to 'xtask/src/codegen.rs')
-rw-r--r--xtask/src/codegen.rs5
1 files changed, 3 insertions, 2 deletions
diff --git a/xtask/src/codegen.rs b/xtask/src/codegen.rs
index 2491952f52..aeb0c00ae6 100644
--- a/xtask/src/codegen.rs
+++ b/xtask/src/codegen.rs
@@ -162,12 +162,12 @@ fn add_preamble(cg: CodegenType, mut text: String) -> String {
/// Checks that the `file` has the specified `contents`. If that is not the
/// case, updates the file and then fails the test.
#[allow(clippy::print_stderr)]
-fn ensure_file_contents(cg: CodegenType, file: &Path, contents: &str, check: bool) {
+fn ensure_file_contents(cg: CodegenType, file: &Path, contents: &str, check: bool) -> bool {
let contents = normalize_newlines(contents);
if let Ok(old_contents) = fs::read_to_string(file) {
if normalize_newlines(&old_contents) == contents {
// File is already up to date.
- return;
+ return false;
}
}
@@ -194,6 +194,7 @@ fn ensure_file_contents(cg: CodegenType, file: &Path, contents: &str, check: boo
let _ = fs::create_dir_all(parent);
}
fs::write(file, contents).unwrap();
+ true
}
}