We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 5cff158 commit 89296baCopy full SHA for 89296ba
xtask/codegen/src/lib.rs
@@ -22,11 +22,8 @@ pub enum UpdateResult {
22
/// A helper to update file on disk if it has changed.
23
/// With verify = false,
24
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
- _ => (),
+ if fs2::read_to_string(path).is_ok_and(|old_contents| old_contents == contents) {
+ return Ok(UpdateResult::NotUpdated);
30
}
31
32
if *mode == Mode::Verify {
0 commit comments