From 6022fb3cc27d3a9c6d59b1e329bb34e09fad5d8c Mon Sep 17 00:00:00 2001 From: Florian Klink Date: Tue, 3 Jun 2025 22:17:18 +0300 Subject: [PATCH] refactor(nix-compat/nixhash): drop impl TryFrom<(HashAlgo, &[u8])> for NixHash This is not used anywhere, and a bit surprising. Consumers can just use from_algo_and_digest. Change-Id: Id4fca98568b1967899fb7428e6767aa993e70c96 Reviewed-on: https://cl.snix.dev/c/snix/+/30550 Autosubmit: Florian Klink Reviewed-by: Ilan Joselevich Tested-by: besadii --- snix/nix-compat/src/nixhash/mod.rs | 12 ------------ 1 file changed, 12 deletions(-) diff --git a/snix/nix-compat/src/nixhash/mod.rs b/snix/nix-compat/src/nixhash/mod.rs index 07720e7ff..48407c0bc 100644 --- a/snix/nix-compat/src/nixhash/mod.rs +++ b/snix/nix-compat/src/nixhash/mod.rs @@ -130,18 +130,6 @@ impl NixHash { } } -impl TryFrom<(HashAlgo, &[u8])> for NixHash { - type Error = Error; - - /// Constructs a new [NixHash] by specifying [HashAlgo] and digest. - /// It can fail if the passed digest length doesn't match what's expected for - /// the passed algo. - fn try_from(value: (HashAlgo, &[u8])) -> NixHashResult { - let (algo, digest) = value; - from_algo_and_digest(algo, digest) - } -} - impl<'de> Deserialize<'de> for NixHash { fn deserialize(deserializer: D) -> Result where