diff options
author | edef <edef@edef.eu> | 2023-10-27T01·12+0000 |
---|---|---|
committer | edef <edef@edef.eu> | 2023-10-27T07·37+0000 |
commit | 6a0a75c8e11aaf8dc8c3114eee354be34b7be16d (patch) | |
tree | d7d928428c71b2e3f47d8f00aa7575a583a5c791 /tvix/castore/src/proto/tests/directory.rs | |
parent | 55c37a2871404e55aa2cb9e864dcfe389ac6015f (diff) |
refactor(tvix): condense long bytestrings r/6883
Change-Id: I3bea0827ec2c8db835334ce378a7bf3a39e9b1a3 Reviewed-on: https://cl.tvl.fyi/c/depot/+/9849 Tested-by: BuildkiteCI Reviewed-by: flokli <flokli@flokli.de>
Diffstat (limited to 'tvix/castore/src/proto/tests/directory.rs')
-rw-r--r-- | tvix/castore/src/proto/tests/directory.rs | 22 |
1 files changed, 7 insertions, 15 deletions
diff --git a/tvix/castore/src/proto/tests/directory.rs b/tvix/castore/src/proto/tests/directory.rs index 69d9b5b4efe6..d4de19b77114 100644 --- a/tvix/castore/src/proto/tests/directory.rs +++ b/tvix/castore/src/proto/tests/directory.rs @@ -1,15 +1,11 @@ use crate::proto::{ Directory, DirectoryNode, FileNode, SymlinkNode, ValidateDirectoryError, ValidateNodeError, }; -use lazy_static::lazy_static; -lazy_static! { - static ref DUMMY_DIGEST: [u8; 32] = [ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, - ]; -} +use hex_literal::hex; + +const DUMMY_DIGEST: [u8; 32] = [0; 32]; + #[test] fn size() { { @@ -145,13 +141,9 @@ fn digest() { assert_eq!( d.digest(), - vec![ - 0xaf, 0x13, 0x49, 0xb9, 0xf5, 0xf9, 0xa1, 0xa6, 0xa0, 0x40, 0x4d, 0xea, 0x36, 0xdc, - 0xc9, 0x49, 0x9b, 0xcb, 0x25, 0xc9, 0xad, 0xc1, 0x12, 0xb7, 0xcc, 0x9a, 0x93, 0xca, - 0xe4, 0x1f, 0x32, 0x62 - ] - .try_into() - .unwrap() + (&hex!("af1349b9f5f9a1a6a0404dea36dcc9499bcb25c9adc112b7cc9a93cae41f3262")) + .try_into() + .unwrap() ) } |