about summary refs log tree commit diff
path: root/tvix/nix-compat/src/nixbase32.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/nixbase32.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/nixbase32.rs')
-rw-r--r--tvix/nix-compat/src/nixbase32.rs4
1 files changed, 2 insertions, 2 deletions
diff --git a/tvix/nix-compat/src/nixbase32.rs b/tvix/nix-compat/src/nixbase32.rs
index 9aed20054602..babf768addf2 100644
--- a/tvix/nix-compat/src/nixbase32.rs
+++ b/tvix/nix-compat/src/nixbase32.rs
@@ -134,12 +134,12 @@ fn find_invalid(input: &[u8]) -> u8 {
 }
 
 /// Returns the decoded length of an input of length len.
-pub fn decode_len(len: usize) -> usize {
+pub const fn decode_len(len: usize) -> usize {
     (len * 5) / 8
 }
 
 /// Returns the encoded length of an input of length len
-pub fn encode_len(len: usize) -> usize {
+pub const fn encode_len(len: usize) -> usize {
     (len * 8 + 4) / 5
 }