mirror of
https://github.com/pezkuwichain/revive-differential-tests.git
synced 2026-06-13 21:01:03 +00:00
Remove un-required function in cached compiler
This commit is contained in:
@@ -325,26 +325,6 @@ impl ArtifactsCache {
|
|||||||
let value = bson::from_slice::<CacheValue>(&value).ok()?;
|
let value = bson::from_slice::<CacheValue>(&value).ok()?;
|
||||||
Some(value)
|
Some(value)
|
||||||
}
|
}
|
||||||
|
|
||||||
#[instrument(level = "debug", skip_all, err)]
|
|
||||||
pub async fn get_or_insert_with(
|
|
||||||
&self,
|
|
||||||
key: &CacheKey<'_>,
|
|
||||||
callback: impl AsyncFnOnce() -> Result<CacheValue>,
|
|
||||||
) -> Result<CacheValue> {
|
|
||||||
match self.get(key).await {
|
|
||||||
Some(value) => {
|
|
||||||
debug!("Cache hit");
|
|
||||||
Ok(value)
|
|
||||||
}
|
|
||||||
None => {
|
|
||||||
debug!("Cache miss");
|
|
||||||
let value = callback().await?;
|
|
||||||
self.insert(key, &value).await?;
|
|
||||||
Ok(value)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Clone, Debug, PartialEq, Eq, Hash, Serialize)]
|
#[derive(Clone, Debug, PartialEq, Eq, Hash, Serialize)]
|
||||||
|
|||||||
Reference in New Issue
Block a user