feat(nix-compat/store_path): validate_name over borrowed data

Change-Id: Ifeb6231f48d4ad267a7acd398b4b3b687ee4d560
Reviewed-on: https://cl.tvl.fyi/c/depot/+/9857
Reviewed-by: flokli <flokli@flokli.de>
Tested-by: BuildkiteCI
This commit is contained in:
edef 2023-10-27 12:02:29 +00:00
parent 6238a05868
commit b994f692d3
2 changed files with 10 additions and 6 deletions

View file

@ -167,7 +167,7 @@ fn build_store_path_from_fingerprint_parts<B: AsRef<[u8]>>(
name: B,
) -> Result<StorePath, Error> {
let name = name.as_ref();
let name = super::validate_name(name.as_ref())?;
let name = super::validate_name(name.as_ref())?.to_owned();
let digest = compress_hash(&{
let mut h = Sha256::new();