Skip to content

Commit 89296ba

Browse files
Update xtask/codegen/src/lib.rs
Co-authored-by: Julian Domke <68325451+juleswritescode@users.noreply.github.com>
1 parent 5cff158 commit 89296ba

File tree

1 file changed

+2
-5
lines changed

1 file changed

+2
-5
lines changed

xtask/codegen/src/lib.rs

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -22,11 +22,8 @@ pub enum UpdateResult {
2222
/// A helper to update file on disk if it has changed.
2323
/// With verify = false,
2424
pub fn update(path: &Path, contents: &str, mode: &Mode) -> Result<UpdateResult> {
25-
match fs2::read_to_string(path) {
26-
Ok(old_contents) if old_contents == contents => {
27-
return Ok(UpdateResult::NotUpdated);
28-
}
29-
_ => (),
25+
if fs2::read_to_string(path).is_ok_and(|old_contents| old_contents == contents) {
26+
return Ok(UpdateResult::NotUpdated);
3027
}
3128

3229
if *mode == Mode::Verify {

0 commit comments

Comments
 (0)