diff options
author | Florian Klink <flokli@flokli.de> | 2024-08-19T13·57+0300 |
---|---|---|
committer | clbot <clbot@tvl.fyi> | 2024-08-19T19·46+0000 |
commit | a259613c76a17f7a6719c18809e054605ef2cfa2 (patch) | |
tree | 379659675b04623a026e6f40af44c35b14a84d95 /tvix/tools/narinfo2parquet/src/main.rs | |
parent | 7612cb4c31fadd7ccaa7672cf551b9d21d7884b4 (diff) |
feat(nix-compat/narinfo/signature): generalize name field r/8540
Requiring `name` to be a `&str` means it'll get annoying to pass around `Signature`, but being able to pass them around in an owned fashion is kinda a requirement for a stronger typed `PathInfo` struct, where we want to have full ownership. Rework the `Signature` struct to become generic over the type of the `name` field. This means, it becomes possible to have owned versions of it. We don't want to impose `String` or `SmolStr` for example, but want to leave it up to the nix-compat user to decide. Provide a type alias for the existing `&str` variant (`SignatureRef`), and use it where we previously used the non-generic `Signature` one. Add some tests to ensure it's possible to *use* `Signature` with both `String` and `SmolStr` (but only pull in `smol_str` as dev dependency for the tests). Also, add some more docstrings, these were a bit sparse. Change-Id: I3f75691498c6bda9cd072d2d9dac83c4f6c57287 Reviewed-on: https://cl.tvl.fyi/c/depot/+/12253 Autosubmit: flokli <flokli@flokli.de> Tested-by: BuildkiteCI Reviewed-by: raitobezarius <tvl@lahfa.xyz>
Diffstat (limited to 'tvix/tools/narinfo2parquet/src/main.rs')
-rw-r--r-- | tvix/tools/narinfo2parquet/src/main.rs | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/tvix/tools/narinfo2parquet/src/main.rs b/tvix/tools/narinfo2parquet/src/main.rs index b96b134f103a..ea3d39af5503 100644 --- a/tvix/tools/narinfo2parquet/src/main.rs +++ b/tvix/tools/narinfo2parquet/src/main.rs @@ -187,7 +187,7 @@ impl FrameBuilder { assert!(entry.signatures.len() <= 1); self.signature .append_option(entry.signatures.get(0).map(|sig| { - assert_eq!(sig.name(), "cache.nixos.org-1"); + assert_eq!(sig.name(), &"cache.nixos.org-1"); sig.bytes() })); |