Skip to content

Commit c0e326d

Browse files
committed
Simplify
1 parent 9e5aaf9 commit c0e326d

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

src/cargo/util/rustc.rs

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -186,15 +186,15 @@ impl Cache {
186186

187187
impl Drop for Cache {
188188
fn drop(&mut self) {
189-
match (&self.cache_location, self.dirty) {
190-
(&Some(ref path), true) => {
191-
let json = serde_json::to_string(&self.data).unwrap();
192-
match paths::write(path, json.as_bytes()) {
193-
Ok(()) => info!("updated rustc info cache"),
194-
Err(e) => warn!("failed to update rustc info cache: {}", e),
195-
}
189+
if !self.dirty {
190+
return;
191+
}
192+
if let Some(ref path) = self.cache_location {
193+
let json = serde_json::to_string(&self.data).unwrap();
194+
match paths::write(path, json.as_bytes()) {
195+
Ok(()) => info!("updated rustc info cache"),
196+
Err(e) => warn!("failed to update rustc info cache: {}", e),
196197
}
197-
_ => (),
198198
}
199199
}
200200
}

0 commit comments

Comments
 (0)