fix: don't fail to consume input iterator in cbor match more operations
This commit is contained in:
parent
5bb05db166
commit
d20e071a4d
1 changed files with 6 additions and 1 deletions
|
@ -606,7 +606,12 @@ fn matchArray(iter_: *[]const u8, arr: anytype, info: anytype) CborError!bool {
|
|||
inline for (info.fields) |f| {
|
||||
const value = @field(arr, f.name);
|
||||
if (isMore(value))
|
||||
return matchArrayMore(&iter, n);
|
||||
if (try matchArrayMore(&iter, n)) {
|
||||
iter_.* = iter;
|
||||
return true;
|
||||
} else {
|
||||
return false;
|
||||
};
|
||||
if (n == 0) return false;
|
||||
const matched = try matchValue(&iter, @field(arr, f.name));
|
||||
if (!matched) return false;
|
||||
|
|
Loading…
Add table
Reference in a new issue