feat(tvix/nix-compat): implement Serialize, Deserialize for NixHash
We use the (slightly more tolerant) from_str to deserialize, and serialize out as SRI. Change-Id: If76b0ed2d4e243904f02df34f6c90b976c0bab8c Reviewed-on: https://cl.tvl.fyi/c/depot/+/11393 Tested-by: BuildkiteCI Reviewed-by: raitobezarius <tvl@lahfa.xyz>
This commit is contained in:
parent
57fba1f167
commit
a2322d7c14
3 changed files with 50 additions and 9 deletions
|
|
@ -61,7 +61,7 @@ impl FetchArgs {
|
|||
name: Option<String>,
|
||||
sha256: Option<String>,
|
||||
mode: HashMode,
|
||||
) -> nixhash::Result<Self> {
|
||||
) -> nixhash::NixHashResult<Self> {
|
||||
Ok(Self {
|
||||
name: name.unwrap_or_else(|| url_basename(&url).to_owned()),
|
||||
url,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue