Skip to content

Commit 09a5bde

Browse files
authored
fix!: replace usage of u16s in generics with u32s (#12)
* fix!: replace usage of u16s in generics with u32s * chore: remove unnecessary cast
1 parent 5d0cc7f commit 09a5bde

File tree

15 files changed

+346
-346
lines changed

15 files changed

+346
-346
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -139,7 +139,7 @@ If the predefined JSON types are not sufficient for your use case, you can defin
139139

140140
The JSON struct in `dep::json_parser::json::JSON` is parametrised with the following parameters:
141141

142-
`struct JSON<let NumBytes: u32, let NumPackedFields: u16, let MaxNumTokens: u16, let MaxNumValues: u16, let MaxKeyFields: u16>`
142+
`struct JSON<let NumBytes: u32, let NumPackedFields: u32, let MaxNumTokens: u32, let MaxNumValues: u32, let MaxKeyFields: u32>`
143143

144144
- `NumBytes` : the maximum size of the initial json blob
145145
- `NumPackedFields` : take `NumBytes / 31`, round up to the nearest integer, then add 3!

src/_comparison_tools/bounds_checker.nr

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -27,14 +27,14 @@ in this case, i == M
2727
* @description this method is cheaper than querying `i < boundary` for `u16` and `u32` types
2828
* cost = 3 gates + 2 gates per iteration
2929
**/
30-
pub fn get_validity_flags<let N: u16>(boundary: u16) -> [Field; N] {
30+
pub fn get_validity_flags<let N: u32>(boundary: u32) -> [Field; N] {
3131
let flags: [Field; N] = __get_validity_flags(boundary);
3232
get_validity_flags_inner(boundary, flags)
3333
}
3434

35-
unconstrained fn __get_validity_flags<let N: u16>(boundary: u16) -> [Field; N] {
35+
unconstrained fn __get_validity_flags<let N: u32>(boundary: u32) -> [Field; N] {
3636
let mut result: [Field; N] = [0; N];
37-
for i in 0..N as u16 {
37+
for i in 0..N {
3838
if i < boundary {
3939
result[i] = 1;
4040
}
@@ -55,7 +55,7 @@ unconstrained fn __get_validity_flags<let N: u16>(boundary: u16) -> [Field; N] {
5555
* aligns with what is expected from testing `i < boundary`
5656
* N.B. this method will revert if `boundary > N`
5757
**/
58-
fn get_validity_flags_inner<let N: u16>(boundary: u16, flags: [Field; N]) -> [Field; N] {
58+
fn get_validity_flags_inner<let N: u32>(boundary: u32, flags: [Field; N]) -> [Field; N] {
5959
let initial_flag = flags[0];
6060
let final_flag = flags[N - 1];
6161

src/_string_tools/slice_packed_field.nr

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -441,8 +441,8 @@ unconstrained fn __slice_field(f: Field, num_bytes: Field) -> [Field; 5] {
441441
}
442442

443443
unconstrained fn __divmod(numerator: Field, denominator: Field) -> (Field, Field) {
444-
let quotient = numerator as u16 / denominator as u16;
445-
let remainder = numerator as u16 % denominator as u16;
444+
let quotient = numerator as u32 / denominator as u32;
445+
let remainder = numerator as u32 % denominator as u32;
446446
(quotient as Field, remainder as Field)
447447
}
448448

@@ -473,7 +473,7 @@ fn divmod_31(numerator: Field) -> (Field, Field) {
473473
unconstrained fn decompose(val: Field) -> [Field; 16] {
474474
let mut r: [Field; 16] = [0; 16];
475475

476-
let mut it = val as u16;
476+
let mut it = val as u32;
477477
for i in 0..16 {
478478
r[i] = (it & 1) as Field;
479479
it >>= 1;
@@ -482,7 +482,7 @@ unconstrained fn decompose(val: Field) -> [Field; 16] {
482482
}
483483

484484
// 5 gates?
485-
pub fn get_last_limb_path<let OutputFields: u16>(last_limb_index: Field) -> [Field; OutputFields] {
485+
pub fn get_last_limb_path<let OutputFields: u32>(last_limb_index: Field) -> [Field; OutputFields] {
486486
// TODO we offset by 1 explain why (0 byte length produces 0 - 1 which = invalid array index. we just add 1 and increase array length by 1 to compensate)
487487
let path = LAST_LIMB_PATH[last_limb_index + 1]; // 2
488488

@@ -550,7 +550,7 @@ pub fn slice_field(f: Field, num_bytes: Field) -> (Field, Field) {
550550
* @brief Given an array of fields that pack 31 bytes, return an array that slices the packed byte array at a given index for a given number of bytes
551551
* @description Some serious dark black magic nonsense going on here. TODO: document
552552
**/
553-
pub fn slice_fields<let InputFields: u16, let OutputFields: u16>(
553+
pub fn slice_fields<let InputFields: u32, let OutputFields: u32>(
554554
data: [Field; InputFields],
555555
start_byte: Field,
556556
num_bytes: Field

src/_string_tools/string_chopper.nr

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
use crate::_string_tools::slice_packed_field::slice_fields;
22

3-
struct StringChopper<let NeedlePackedFields: u16> {}
3+
struct StringChopper<let NeedlePackedFields: u32> {}
44

5-
impl<let NeedlePackedFields: u16> StringChopper<NeedlePackedFields> {
6-
fn slice_string<let StringBytes: u16, let HaystackPackedFields: u16>(
5+
impl<let NeedlePackedFields: u32> StringChopper<NeedlePackedFields> {
6+
fn slice_string<let StringBytes: u32, let HaystackPackedFields: u32>(
77
_: Self,
88
haystack: [Field; HaystackPackedFields],
99
start_bytes: Field,

src/_table_generation/make_tables.nr

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -341,12 +341,12 @@ unconstrained fn make_token_validation_table() -> [Field; NUM_TOKENS * NUM_TOKEN
341341
single_value_layer_flags[KEY_TOKEN] = no_token_outcomes;
342342

343343
let mut flattened_flags: [Field; NUM_TOKENS * NUM_TOKENS * 3] = [0; NUM_TOKENS * NUM_TOKENS * 3];
344-
let NN = NUM_TOKENS * NUM_TOKENS as Field;
344+
let NN = (NUM_TOKENS * NUM_TOKENS) as Field;
345345
for j in 0..NUM_TOKENS as u32 {
346346
for k in 0..NUM_TOKENS as u32 {
347-
flattened_flags[OBJECT_LAYER * NN + j as Field * NUM_TOKENS + k as Field] = object_layer_flags[j][k];
348-
flattened_flags[ARRAY_LAYER * NN + j as Field * NUM_TOKENS + k as Field] = array_layer_flags[j][k];
349-
flattened_flags[SINGLE_VALUE_LAYER * NN + j as Field * NUM_TOKENS + k as Field] = single_value_layer_flags[j][k];
347+
flattened_flags[OBJECT_LAYER * NN + j as Field * (NUM_TOKENS as Field) + k as Field] = object_layer_flags[j][k];
348+
flattened_flags[ARRAY_LAYER * NN + j as Field * (NUM_TOKENS as Field) + k as Field] = array_layer_flags[j][k];
349+
flattened_flags[SINGLE_VALUE_LAYER * NN + j as Field * (NUM_TOKENS as Field) + k as Field] = single_value_layer_flags[j][k];
350350
}
351351
}
352352
flattened_flags
@@ -541,17 +541,17 @@ unconstrained fn generate_token_flags_table() -> [Field; NUM_TOKENS * 2] {
541541
numeric_flags.new_context = ARRAY_LAYER;
542542
literal_flags.new_context = ARRAY_LAYER;
543543

544-
flags[NUM_TOKENS + NO_TOKEN] = no_token_flags;
545-
flags[NUM_TOKENS + BEGIN_OBJECT_TOKEN] = begin_object_flags;
546-
flags[NUM_TOKENS + END_OBJECT_TOKEN] = end_object_flags;
547-
flags[NUM_TOKENS + BEGIN_ARRAY_TOKEN] = begin_array_flags;
548-
flags[NUM_TOKENS + END_ARRAY_TOKEN] = end_array_flags;
549-
flags[NUM_TOKENS + KEY_SEPARATOR_TOKEN] = no_token_flags;
550-
flags[NUM_TOKENS + VALUE_SEPARATOR_TOKEN] = no_token_flags;
551-
flags[NUM_TOKENS + STRING_TOKEN] = string_flags;
552-
flags[NUM_TOKENS + NUMERIC_TOKEN] = numeric_flags;
553-
flags[NUM_TOKENS + LITERAL_TOKEN] = literal_flags;
554-
flags[NUM_TOKENS + KEY_TOKEN] = key_token_flags;
544+
flags[NUM_TOKENS + (NO_TOKEN as u32)] = no_token_flags;
545+
flags[NUM_TOKENS + (BEGIN_OBJECT_TOKEN as u32)] = begin_object_flags;
546+
flags[NUM_TOKENS + (END_OBJECT_TOKEN as u32)] = end_object_flags;
547+
flags[NUM_TOKENS + (BEGIN_ARRAY_TOKEN as u32)] = begin_array_flags;
548+
flags[NUM_TOKENS + (END_ARRAY_TOKEN as u32)] = end_array_flags;
549+
flags[NUM_TOKENS + (KEY_SEPARATOR_TOKEN as u32)] = no_token_flags;
550+
flags[NUM_TOKENS + (VALUE_SEPARATOR_TOKEN as u32)] = no_token_flags;
551+
flags[NUM_TOKENS + (STRING_TOKEN as u32)] = string_flags;
552+
flags[NUM_TOKENS + (NUMERIC_TOKEN as u32)] = numeric_flags;
553+
flags[NUM_TOKENS + (LITERAL_TOKEN as u32)] = literal_flags;
554+
flags[NUM_TOKENS + (KEY_TOKEN as u32)] = key_token_flags;
555555

556556
let mut result: [Field; NUM_TOKENS * 2] = [0; NUM_TOKENS * 2];
557557
for i in 0..(NUM_TOKENS as u32 * 2) {

src/get_array.nr

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ use crate::getters::JSONValue;
88
/**
99
* @brief getter methods for extracting array types out of a JSON struct
1010
**/
11-
impl<let NumBytes: u32, let NumPackedFields: u16, let MaxNumTokens: u16, let MaxNumValues: u16, let MaxKeyFields: u16> JSON<NumBytes,NumPackedFields, MaxNumTokens, MaxNumValues, MaxKeyFields> {
11+
impl<let NumBytes: u32, let NumPackedFields: u32, let MaxNumTokens: u32, let MaxNumValues: u32, let MaxKeyFields: u32> JSON<NumBytes,NumPackedFields, MaxNumTokens, MaxNumValues, MaxKeyFields> {
1212

1313
/**
1414
* @brief if the root JSON is an array, return its length
@@ -23,7 +23,7 @@ impl<let NumBytes: u32, let NumPackedFields: u16, let MaxNumTokens: u16, let Max
2323
* @brief if the root JSON is an object, extract an array given by `key`
2424
* @description returns an Option<JSON> where, if the array exists, the JSON object will have the requested array as its root value
2525
**/
26-
fn get_array<let KeyBytes: u16>(self, key: [u8; KeyBytes]) -> Option<Self> {
26+
fn get_array<let KeyBytes: u32>(self, key: [u8; KeyBytes]) -> Option<Self> {
2727
assert(self.layer_type_of_root != ARRAY_LAYER, "cannot extract array elements via a key");
2828
let (exists, key_index) = self.key_exists_impl(key);
2929
let entry: JSONEntry = self.json_entries_packed[key_index].into();
@@ -44,7 +44,7 @@ impl<let NumBytes: u32, let NumPackedFields: u16, let MaxNumTokens: u16, let Max
4444
* @brief if the root JSON is an object, extract an array given by `key`
4545
* @description will revert if the array does not exist
4646
**/
47-
fn get_array_unchecked<let KeyBytes: u16>(self, key: [u8; KeyBytes]) -> Self {
47+
fn get_array_unchecked<let KeyBytes: u32>(self, key: [u8; KeyBytes]) -> Self {
4848
assert(self.layer_type_of_root != ARRAY_LAYER, "cannot extract array elements via a key");
4949

5050
let (entry, key_index) = self.get_json_entry_unchecked_with_key_index(key);
@@ -62,7 +62,7 @@ impl<let NumBytes: u32, let NumPackedFields: u16, let MaxNumTokens: u16, let Max
6262
/**
6363
* @brief same as `get_array` for where the key length may be less than KeyBytes
6464
**/
65-
fn get_array_var<let KeyBytes: u16>(self, key: BoundedVec<u8, KeyBytes>) -> Option<Self> {
65+
fn get_array_var<let KeyBytes: u32>(self, key: BoundedVec<u8, KeyBytes>) -> Option<Self> {
6666
assert(self.layer_type_of_root != ARRAY_LAYER, "cannot extract array elements via a key");
6767
let (exists, key_index) = self.key_exists_impl_var(key);
6868
let entry: JSONEntry = self.json_entries_packed[key_index].into();
@@ -83,7 +83,7 @@ impl<let NumBytes: u32, let NumPackedFields: u16, let MaxNumTokens: u16, let Max
8383
/**
8484
* @brief same as `get_array_unchecked` for where the key length may be less than KeyBytes
8585
**/
86-
fn get_array_unchecked_var<let KeyBytes: u16>(self, key: BoundedVec<u8, KeyBytes>) -> Self {
86+
fn get_array_unchecked_var<let KeyBytes: u32>(self, key: BoundedVec<u8, KeyBytes>) -> Self {
8787
assert(self.layer_type_of_root != ARRAY_LAYER, "cannot extract array elements via a key");
8888

8989
let (entry, key_index) = self.get_json_entry_unchecked_with_key_index_var(key);

src/get_literal.nr

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -65,13 +65,13 @@ fn extract_literal_from_array(
6565
/**
6666
* @brief getter methods for extracting literal values out of a JSON struct
6767
**/
68-
impl<let NumBytes: u32, let NumPackedFields: u16, let MaxNumTokens: u16, let MaxNumValues: u16, let MaxKeyFields: u16> JSON<NumBytes,NumPackedFields, MaxNumTokens, MaxNumValues, MaxKeyFields> {
68+
impl<let NumBytes: u32, let NumPackedFields: u32, let MaxNumTokens: u32, let MaxNumValues: u32, let MaxKeyFields: u32> JSON<NumBytes,NumPackedFields, MaxNumTokens, MaxNumValues, MaxKeyFields> {
6969

7070
/**
7171
* @brief if the root JSON is an object, extract a literal value given by `key`
7272
* @description returns an Option<JSONLiteral> which will be null if the literal does not exist
7373
**/
74-
fn get_literal<let KeyBytes: u16>(self, key: [u8; KeyBytes]) -> Option<JSONLiteral> {
74+
fn get_literal<let KeyBytes: u32>(self, key: [u8; KeyBytes]) -> Option<JSONLiteral> {
7575
assert(self.layer_type_of_root != ARRAY_LAYER, "cannot extract array elements via a key");
7676

7777
let (exists, entry) = self.get_json_entry(key);
@@ -87,7 +87,7 @@ impl<let NumBytes: u32, let NumPackedFields: u16, let MaxNumTokens: u16, let Max
8787
* @brief if the root JSON is an object, extract a literal value given by `key`
8888
* @description will revert if the literal does not exist
8989
**/
90-
fn get_literal_unchecked<let KeyBytes: u16>(self, key: [u8; KeyBytes]) -> JSONLiteral {
90+
fn get_literal_unchecked<let KeyBytes: u32>(self, key: [u8; KeyBytes]) -> JSONLiteral {
9191
assert(self.layer_type_of_root != ARRAY_LAYER, "cannot extract array elements via a key");
9292

9393
let entry= self.get_json_entry_unchecked(key);
@@ -102,7 +102,7 @@ impl<let NumBytes: u32, let NumPackedFields: u16, let MaxNumTokens: u16, let Max
102102
/**
103103
* @brief same as `get_literal` for where the key length may be less than KeyBytes
104104
**/
105-
fn get_literal_var<let KeyBytes: u16>(self, key: BoundedVec<u8, KeyBytes>) -> Option<JSONLiteral> {
105+
fn get_literal_var<let KeyBytes: u32>(self, key: BoundedVec<u8, KeyBytes>) -> Option<JSONLiteral> {
106106
assert(self.layer_type_of_root != ARRAY_LAYER, "cannot extract array elements via a key");
107107

108108
let (exists, entry) = self.get_json_entry_var(key);
@@ -117,7 +117,7 @@ impl<let NumBytes: u32, let NumPackedFields: u16, let MaxNumTokens: u16, let Max
117117
/**
118118
* @brief same as `get_literal_unchecked` for where the key length may be less than KeyBytes
119119
**/
120-
fn get_literal_unchecked_var<let KeyBytes: u16>(self, key: BoundedVec<u8, KeyBytes>) -> JSONLiteral {
120+
fn get_literal_unchecked_var<let KeyBytes: u32>(self, key: BoundedVec<u8, KeyBytes>) -> JSONLiteral {
121121
assert(self.layer_type_of_root != ARRAY_LAYER, "cannot extract array elements via a key");
122122

123123
let entry= self.get_json_entry_unchecked_var(key);

src/get_number.nr

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -28,13 +28,13 @@ fn extract_number_from_array(arr: [u8; U64_LENGTH_AS_BASE10_STRING], json_length
2828
* @note numeric values must fit into a `u64` type.
2929
* decimal values and scientific notation are not yet supported
3030
**/
31-
impl<let NumBytes: u32, let NumPackedFields: u16, let MaxNumTokens: u16, let MaxNumValues: u16, let MaxKeyFields: u16> JSON<NumBytes,NumPackedFields, MaxNumTokens, MaxNumValues, MaxKeyFields> {
31+
impl<let NumBytes: u32, let NumPackedFields: u32, let MaxNumTokens: u32, let MaxNumValues: u32, let MaxKeyFields: u32> JSON<NumBytes,NumPackedFields, MaxNumTokens, MaxNumValues, MaxKeyFields> {
3232

3333
/**
3434
* @brief if the root JSON is an object, extract a numeric value given by `key`
3535
* @description returns an Option<u64> which will be null if the key does not exist
3636
**/
37-
fn get_number<let KeyBytes: u16>(self, key: [u8; KeyBytes]) -> Option<u64> {
37+
fn get_number<let KeyBytes: u32>(self, key: [u8; KeyBytes]) -> Option<u64> {
3838
let (exists, entry) = self.get_json_entry(key);
3939
assert(
4040
(entry.entry_type - NUMERIC_TOKEN) * exists as Field == 0, "get_number: entry exists but is not a number!"
@@ -48,7 +48,7 @@ impl<let NumBytes: u32, let NumPackedFields: u16, let MaxNumTokens: u16, let Max
4848
* @brief if the root JSON is an object, extract a u64 value given by `key`
4949
* @description will revert if the number does not exist
5050
**/
51-
fn get_number_unchecked<let KeyBytes: u16>(self, key: [u8; KeyBytes]) -> u64 {
51+
fn get_number_unchecked<let KeyBytes: u32>(self, key: [u8; KeyBytes]) -> u64 {
5252
let entry = self.get_json_entry_unchecked(key);
5353
assert(entry.entry_type == NUMERIC_TOKEN, "get_number_unchecked: entry exists but is not a number!");
5454
let mut parsed_string: [u8; U64_LENGTH_AS_BASE10_STRING] = self.extract_string_entry(entry);
@@ -59,7 +59,7 @@ impl<let NumBytes: u32, let NumPackedFields: u16, let MaxNumTokens: u16, let Max
5959
/**
6060
* @brief same as `get_number` for where the key length may be less than KeyBytes
6161
**/
62-
fn get_number_var<let KeyBytes: u16>(self, key: BoundedVec<u8, KeyBytes>) -> Option<u64> {
62+
fn get_number_var<let KeyBytes: u32>(self, key: BoundedVec<u8, KeyBytes>) -> Option<u64> {
6363
let (exists, entry) = self.get_json_entry_var(key);
6464
assert(
6565
(entry.entry_type - NUMERIC_TOKEN) * exists as Field == 0, "get_number: entry exists but is not a number!"
@@ -72,7 +72,7 @@ impl<let NumBytes: u32, let NumPackedFields: u16, let MaxNumTokens: u16, let Max
7272
/**
7373
* @brief same as `get_number_unchecked` for where the key length may be less than KeyBytes
7474
**/
75-
fn get_number_unchecked_var<let KeyBytes: u16>(self, key: BoundedVec<u8, KeyBytes>) -> u64 {
75+
fn get_number_unchecked_var<let KeyBytes: u32>(self, key: BoundedVec<u8, KeyBytes>) -> u64 {
7676
let entry = self.get_json_entry_unchecked_var(key);
7777
assert(entry.entry_type == NUMERIC_TOKEN, "get_number_unchecked: entry exists but is not a number!");
7878
let mut parsed_string: [u8; U64_LENGTH_AS_BASE10_STRING] = self.extract_string_entry(entry);

src/get_object.nr

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,13 +8,13 @@ use crate::getters::JSONValue;
88
/**
99
* @brief getter methods for extracting object types out of a JSON struct
1010
**/
11-
impl<let NumBytes: u32, let NumPackedFields: u16, let MaxNumTokens: u16, let MaxNumValues: u16, let MaxKeyFields: u16> JSON<NumBytes,NumPackedFields, MaxNumTokens, MaxNumValues, MaxKeyFields> {
11+
impl<let NumBytes: u32, let NumPackedFields: u32, let MaxNumTokens: u32, let MaxNumValues: u32, let MaxKeyFields: u32> JSON<NumBytes,NumPackedFields, MaxNumTokens, MaxNumValues, MaxKeyFields> {
1212

1313
/**
1414
* @brief if the root JSON is an object, extract a child object given by `key`
1515
* @description returns an Option<JSON> where, if the object exists, the JSON object will have the requested object as its root value
1616
**/
17-
fn get_object<let KeyBytes: u16>(self, key: [u8; KeyBytes]) -> Option<Self> {
17+
fn get_object<let KeyBytes: u32>(self, key: [u8; KeyBytes]) -> Option<Self> {
1818
assert(self.layer_type_of_root != ARRAY_LAYER, "cannot extract array elements via a key");
1919

2020
let (exists, key_index) = self.key_exists_impl(key);
@@ -35,7 +35,7 @@ impl<let NumBytes: u32, let NumPackedFields: u16, let MaxNumTokens: u16, let Max
3535
* @brief if the root JSON is an object, extract a child object given by `key`
3636
* @description will revert if the requested object does not exist
3737
**/
38-
fn get_object_unchecked<let KeyBytes: u16>(self, key: [u8; KeyBytes]) -> Self {
38+
fn get_object_unchecked<let KeyBytes: u32>(self, key: [u8; KeyBytes]) -> Self {
3939
assert(self.layer_type_of_root != ARRAY_LAYER, "cannot extract array elements via a key");
4040
let (entry, key_index) = self.get_json_entry_unchecked_with_key_index(key);
4141
let entry: JSONEntry = self.json_entries_packed[key_index].into();
@@ -52,7 +52,7 @@ impl<let NumBytes: u32, let NumPackedFields: u16, let MaxNumTokens: u16, let Max
5252
/**
5353
* @brief same as `get_object` for where the key length may be less than KeyBytes
5454
**/
55-
fn get_object_var<let KeyBytes: u16>(self, key: BoundedVec<u8, KeyBytes>) -> Option<Self> {
55+
fn get_object_var<let KeyBytes: u32>(self, key: BoundedVec<u8, KeyBytes>) -> Option<Self> {
5656
assert(self.layer_type_of_root != ARRAY_LAYER, "cannot extract array elements via a key");
5757

5858
let (exists, key_index) = self.key_exists_impl_var(key);
@@ -72,7 +72,7 @@ impl<let NumBytes: u32, let NumPackedFields: u16, let MaxNumTokens: u16, let Max
7272
/**
7373
* @brief same as `get_object_unchecked` for where the key length may be less than KeyBytes
7474
**/
75-
fn get_object_unchecked_var<let KeyBytes: u16>(self, key: BoundedVec<u8, KeyBytes>) -> Self {
75+
fn get_object_unchecked_var<let KeyBytes: u32>(self, key: BoundedVec<u8, KeyBytes>) -> Self {
7676
assert(self.layer_type_of_root != ARRAY_LAYER, "cannot extract array elements via a key");
7777
let (entry, key_index) = self.get_json_entry_unchecked_with_key_index_var(key);
7878
let entry: JSONEntry = self.json_entries_packed[key_index].into();

0 commit comments

Comments
 (0)