refactor(nix-compat/narinfo/fingerprint): move to StorePathRef

With the introduction of StorePathRef::to_absolute_path(), there's no
need to convert this StorePathRef to a StorePath first.

Change-Id: I634c977c4b63858e4f329fd21726e0611b99da4a
Reviewed-on: https://cl.tvl.fyi/c/depot/+/10388
Tested-by: BuildkiteCI
Reviewed-by: edef <edef@edef.eu>
Autosubmit: flokli <flokli@flokli.de>
This commit is contained in:
Florian Klink 2023-12-21 16:01:00 +02:00 committed by clbot
parent 91deb67de9
commit ea8fdb9304

View file

@ -11,12 +11,12 @@ pub fn fingerprint<'a, R: Iterator<Item = &'a StorePathRef<'a>>>(
) -> String {
format!(
"1;{};sha256:{};{};{}",
store_path.to_owned().to_absolute_path(), // TODO: move to StorePathRef
store_path.to_absolute_path(),
nixbase32::encode(nar_sha256),
nar_size,
// references are absolute paths, joined with `,`.
references
.map(|r| r.to_owned().to_absolute_path())
.map(|r| r.to_absolute_path())
.collect::<Vec<String>>()
.join(",")
)