fix: matchArray should not return an error on match failure
This commit is contained in:
parent
183248d7f2
commit
b32ffa3a52
1 changed files with 5 additions and 1 deletions
|
@ -759,7 +759,11 @@ fn matchArrayMore(iter_: *[]const u8, n_: u64) Error!bool {
|
|||
|
||||
fn matchArray(iter_: *[]const u8, arr: anytype, info: anytype) Error!bool {
|
||||
var iter = iter_.*;
|
||||
var n = try decodeArrayHeader(&iter);
|
||||
var n = decodeArrayHeader(&iter) catch |e| switch (e) {
|
||||
error.InvalidArrayType => return false,
|
||||
error.InvalidPIntType => return e,
|
||||
error.TooShort => return e,
|
||||
};
|
||||
inline for (info.fields) |f| {
|
||||
const value = @field(arr, f.name);
|
||||
if (isMore(value))
|
||||
|
|
Loading…
Add table
Reference in a new issue