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 9e5aaf9 commit c0e326dCopy full SHA for c0e326d
src/cargo/util/rustc.rs
@@ -186,15 +186,15 @@ impl Cache {
186
187
impl Drop for Cache {
188
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
- }
+ 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"),
196
+ Err(e) => warn!("failed to update rustc info cache: {}", e),
197
}
- _ => (),
198
199
200
0 commit comments