Skip to content

Commit

Permalink
minor fix for ArrayBackSlice callback
Browse files Browse the repository at this point in the history
  • Loading branch information
r4gus committed May 22, 2024
1 parent 6fa20a0 commit 9871dda
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion src/parse.zig
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,17 @@ pub fn ArrayBackedSlice(
switch (t) {
.Byte => try build.writeByteString(out, self.get()),
.Text => try build.writeTextString(out, self.get()),
.Other => try stringify(self.get(), options, out),
.Other => {
// Make sure this is set to false otherwise, nested cborStringify calls
// are prevented.
//
// TODO: This will backfire for nested ArrayBackedSlices, maybe its
// time to switch to a unique identifier based to the given cborStringify
// function.
var o = options;
o.from_callback = false;
try stringify(self.get(), o, out);
},
}
}

Expand Down

0 comments on commit 9871dda

Please sign in to comment.