From b88217cc548a91d0c168f8604a32b78f3366fe46 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kat=20March=C3=A1n?= Date: Thu, 9 Mar 2023 18:23:50 -0800 Subject: [PATCH] feat(link): implement hard_link_hash_sync too --- src/get.rs | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/get.rs b/src/get.rs index 07f84f2..ac1161d 100644 --- a/src/get.rs +++ b/src/get.rs @@ -627,6 +627,16 @@ where inner(cache.as_ref(), key.as_ref(), to.as_ref()) } +/// Hard links a cache entry by integrity address to a specified location, +/// verifying contents as hard links are created. +pub fn hard_link_hash_sync(cache: P, sri: &Integrity, to: Q) -> Result<()> +where + P: AsRef, + Q: AsRef, +{ + read::hard_link(cache.as_ref(), sri, to.as_ref()) +} + /// Hard links a cache entry by integrity address to a specified location. The /// cache entry contents will not be checked, and all the usual caveats of /// hard links apply: The potentially-shared cache might be corrupted if the