layer.rs: fix error 'captured variable cannot escape FnMut closure body"

This commit is contained in:
Christian Schwarz
2024-06-21 09:55:40 +00:00
parent ba13f2a90a
commit 81f13e17ce

View File

@@ -1664,7 +1664,7 @@ impl DownloadedLayer {
owner: &Arc<LayerInner>,
ctx: &mut RequestContext,
) -> anyhow::Result<&'a LayerKind> {
let init = || async {
let init = async {
assert_eq!(
Weak::as_ptr(&self.owner),
Arc::as_ptr(owner),
@@ -1719,7 +1719,7 @@ impl DownloadedLayer {
}
};
self.kind
.get_or_try_init(init)
.get_or_try_init(move || init)
// return transient errors using `?`
.await?
.as_ref()