about summary refs log tree commit diff
path: root/tvix/nix-compat/src/store_path/mod.rs
diff options
context:
space:
mode:
authoredef <edef@edef.eu>2023-11-04T16·22+0000
committeredef <edef@edef.eu>2023-11-04T16·29+0000
commit6cec663aa164a4c419a9f0d999d8861ae84ee80b (patch)
treeae93a9069d598422b5572636effc6bae6ced4e50 /tvix/nix-compat/src/store_path/mod.rs
parentc8cc31e07939feb707a60d2616de277f9227d6e6 (diff)
fix(nix-compat/nixbase32): mark encode_len/decode_len const r/6940
Change-Id: Ib688bbb37cd54cfcd01e5cb3a8c376414ee8311e
Reviewed-on: https://cl.tvl.fyi/c/depot/+/9926
Reviewed-by: flokli <flokli@flokli.de>
Tested-by: BuildkiteCI
Diffstat (limited to 'tvix/nix-compat/src/store_path/mod.rs')
-rw-r--r--tvix/nix-compat/src/store_path/mod.rs9
1 files changed, 1 insertions, 8 deletions
diff --git a/tvix/nix-compat/src/store_path/mod.rs b/tvix/nix-compat/src/store_path/mod.rs
index faa2280e59..10bf1eb026 100644
--- a/tvix/nix-compat/src/store_path/mod.rs
+++ b/tvix/nix-compat/src/store_path/mod.rs
@@ -15,9 +15,7 @@ mod utils;
 pub use utils::*;
 
 pub const DIGEST_SIZE: usize = 20;
-// lazy_static doesn't allow us to call NIXBASE32.encode_len(), so we ran it
-// manually and have an assert in the tests.
-pub const ENCODED_DIGEST_SIZE: usize = 32;
+pub const ENCODED_DIGEST_SIZE: usize = nixbase32::encode_len(DIGEST_SIZE);
 
 // The store dir prefix, without trailing slash.
 // That's usually where the Nix store is mounted at.
@@ -299,11 +297,6 @@ mod tests {
     use super::{Error, StorePath};
 
     #[test]
-    fn encoded_digest_size() {
-        assert_eq!(ENCODED_DIGEST_SIZE, nixbase32::encode_len(DIGEST_SIZE));
-    }
-
-    #[test]
     fn happy_path() {
         let example_nix_path_str =
             "00bgd045z0d4icpbc2yyz4gx48ak44la-net-tools-1.60_p20170221182432";