refactor(tvix/glue): take &CAHash, not CAHash

We use a bit less cloning that way.

Change-Id: I28bf99577e4a481e35fbf99d0724adab5502a1bd
Reviewed-on: https://cl.tvl.fyi/c/depot/+/11874
Reviewed-by: Connor Brewster <cbrewster@hey.com>
Tested-by: BuildkiteCI
Reviewed-by: Ilan Joselevich <personal@ilanjoselevich.com>
This commit is contained in:
Florian Klink 2024-06-25 21:48:45 +03:00 committed by flokli
parent 78eb22c54d
commit 540e566900
3 changed files with 16 additions and 14 deletions

View file

@ -81,7 +81,7 @@ pub fn path_to_name(path: &Path) -> std::io::Result<&str> {
pub fn derive_nar_ca_path_info(
nar_size: u64,
nar_sha256: [u8; 32],
ca: Option<CAHash>,
ca: Option<&CAHash>,
root_node: Node,
) -> PathInfo {
// assemble the [crate::proto::PathInfo] object.
@ -145,7 +145,7 @@ where
let path_info = derive_nar_ca_path_info(
nar_size,
nar_sha256,
Some(CAHash::Nar(NixHash::Sha256(nar_sha256))),
Some(&CAHash::Nar(NixHash::Sha256(nar_sha256))),
root_node,
);