From: Aleksey Kladov Date: Mon, 16 Apr 2018 15:53:12 +0000 (+0300) Subject: Simplify X-Git-Tag: archive/raspbian/0.35.0-2+rpi1~3^2^2^2^2^2^2^2~22^2~1^2~69^2~1 X-Git-Url: https://dgit.raspbian.org/?a=commitdiff_plain;h=c0e326d75a32765560a4cbfdb6ce6050afad2a18;p=cargo.git Simplify --- diff --git a/src/cargo/util/rustc.rs b/src/cargo/util/rustc.rs index 53f74e130..25bb9b5ba 100644 --- a/src/cargo/util/rustc.rs +++ b/src/cargo/util/rustc.rs @@ -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), } - _ => (), } } }