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 <flokli@flokli.de> Reviewed-by: Ilan Joselevich <personal@ilanjoselevich.com> Tested-by: besadii
This commit is contained in:
parent
2a01c40e77
commit
6022fb3cc2
1 changed files with 0 additions and 12 deletions
|
|
@ -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<Self> {
|
|
||||||
let (algo, digest) = value;
|
|
||||||
from_algo_and_digest(algo, digest)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
impl<'de> Deserialize<'de> for NixHash {
|
impl<'de> Deserialize<'de> for NixHash {
|
||||||
fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>
|
fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>
|
||||||
where
|
where
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue