diff options
author | Florian Klink <flokli@flokli.de> | 2023-07-19T15·52+0300 |
---|---|---|
committer | clbot <clbot@tvl.fyi> | 2023-07-22T09·03+0000 |
commit | 432222f098bfceb033e63e9a63687e35574457f9 (patch) | |
tree | 43a5e38cf79827dd63aa2adbd841da6aa62cf1de /tvix/store/src/proto/tests/directory.rs | |
parent | 7971d7d9ff42ed00f6f70121f372dd744f45915b (diff) |
feat(tvix/store/proto): use Bytes instead of Vec<u8> r/6439
Makes use of https://github.com/tokio-rs/prost/pull/341, which makes our bytes field cheaper to clone. It's a bit annoying to configure due to https://github.com/hyperium/tonic/issues/908, but the workaround does get the job done. Change-Id: I25714600b041bb5432d3adf5859b151e72b12778 Reviewed-on: https://cl.tvl.fyi/c/depot/+/8975 Reviewed-by: raitobezarius <tvl@lahfa.xyz> Tested-by: BuildkiteCI Reviewed-by: tazjin <tazjin@tvl.su> Autosubmit: flokli <flokli@flokli.de>
Diffstat (limited to 'tvix/store/src/proto/tests/directory.rs')
-rw-r--r-- | tvix/store/src/proto/tests/directory.rs | 30 |
1 files changed, 15 insertions, 15 deletions
diff --git a/tvix/store/src/proto/tests/directory.rs b/tvix/store/src/proto/tests/directory.rs index 22b10ca746a9..eed49b2b593c 100644 --- a/tvix/store/src/proto/tests/directory.rs +++ b/tvix/store/src/proto/tests/directory.rs @@ -18,7 +18,7 @@ fn size() { let d = Directory { directories: vec![DirectoryNode { name: "foo".into(), - digest: DUMMY_DIGEST.to_vec(), + digest: DUMMY_DIGEST.to_vec().into(), size: 0, }], ..Default::default() @@ -29,7 +29,7 @@ fn size() { let d = Directory { directories: vec![DirectoryNode { name: "foo".into(), - digest: DUMMY_DIGEST.to_vec(), + digest: DUMMY_DIGEST.to_vec().into(), size: 4, }], ..Default::default() @@ -40,7 +40,7 @@ fn size() { let d = Directory { files: vec![FileNode { name: "foo".into(), - digest: DUMMY_DIGEST.to_vec(), + digest: DUMMY_DIGEST.to_vec().into(), size: 42, executable: false, }], @@ -88,7 +88,7 @@ fn validate_invalid_names() { let d = Directory { directories: vec![DirectoryNode { name: "".into(), - digest: DUMMY_DIGEST.to_vec(), + digest: DUMMY_DIGEST.to_vec().into(), size: 42, }], ..Default::default() @@ -105,7 +105,7 @@ fn validate_invalid_names() { let d = Directory { directories: vec![DirectoryNode { name: ".".into(), - digest: DUMMY_DIGEST.to_vec(), + digest: DUMMY_DIGEST.to_vec().into(), size: 42, }], ..Default::default() @@ -122,7 +122,7 @@ fn validate_invalid_names() { let d = Directory { files: vec![FileNode { name: "..".into(), - digest: DUMMY_DIGEST.to_vec(), + digest: DUMMY_DIGEST.to_vec().into(), size: 42, executable: false, }], @@ -174,7 +174,7 @@ fn validate_invalid_digest() { let d = Directory { directories: vec![DirectoryNode { name: "foo".into(), - digest: vec![0x00, 0x42], // invalid length + digest: vec![0x00, 0x42].into(), // invalid length size: 42, }], ..Default::default() @@ -195,12 +195,12 @@ fn validate_sorting() { directories: vec![ DirectoryNode { name: "b".into(), - digest: DUMMY_DIGEST.to_vec(), + digest: DUMMY_DIGEST.to_vec().into(), size: 42, }, DirectoryNode { name: "a".into(), - digest: DUMMY_DIGEST.to_vec(), + digest: DUMMY_DIGEST.to_vec().into(), size: 42, }, ], @@ -220,12 +220,12 @@ fn validate_sorting() { directories: vec![ DirectoryNode { name: "a".into(), - digest: DUMMY_DIGEST.to_vec(), + digest: DUMMY_DIGEST.to_vec().into(), size: 42, }, DirectoryNode { name: "a".into(), - digest: DUMMY_DIGEST.to_vec(), + digest: DUMMY_DIGEST.to_vec().into(), size: 42, }, ], @@ -245,12 +245,12 @@ fn validate_sorting() { directories: vec![ DirectoryNode { name: "a".into(), - digest: DUMMY_DIGEST.to_vec(), + digest: DUMMY_DIGEST.to_vec().into(), size: 42, }, DirectoryNode { name: "b".into(), - digest: DUMMY_DIGEST.to_vec(), + digest: DUMMY_DIGEST.to_vec().into(), size: 42, }, ], @@ -266,12 +266,12 @@ fn validate_sorting() { directories: vec![ DirectoryNode { name: "b".into(), - digest: DUMMY_DIGEST.to_vec(), + digest: DUMMY_DIGEST.to_vec().into(), size: 42, }, DirectoryNode { name: "c".into(), - digest: DUMMY_DIGEST.to_vec(), + digest: DUMMY_DIGEST.to_vec().into(), size: 42, }, ], |