Skip to content

Commit

Permalink
Simplify
Browse files Browse the repository at this point in the history
  • Loading branch information
matklad committed Apr 16, 2018
1 parent 9e5aaf9 commit c0e326d
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions src/cargo/util/rustc.rs
Original file line number Diff line number Diff line change
Expand Up @@ -186,15 +186,15 @@ impl Cache {

impl Drop for Cache {
fn drop(&mut self) {
match (&self.cache_location, self.dirty) {
(&Some(ref path), true) => {
let json = serde_json::to_string(&self.data).unwrap();
match paths::write(path, json.as_bytes()) {
Ok(()) => info!("updated rustc info cache"),
Err(e) => warn!("failed to update rustc info cache: {}", e),
}
if !self.dirty {
return;
}
if let Some(ref path) = self.cache_location {
let json = serde_json::to_string(&self.data).unwrap();
match paths::write(path, json.as_bytes()) {
Ok(()) => info!("updated rustc info cache"),
Err(e) => warn!("failed to update rustc info cache: {}", e),
}
_ => (),
}
}
}
Expand Down

0 comments on commit c0e326d

Please sign in to comment.