Closed mladedav closed 2 months ago
Users may want to pass data to Subscribes which is not valid UTF-8. Currently, it would have to be encoded into &str to be passed as a field value.
Subscribe
&str
This branch adds a record_byte_slice method to Visit. It has an implementation falling back to record_debug so it is not be a breaking change.
record_byte_slice
Visit
record_debug
JsonVisitor got an overridden implementation as it should not use Debug output and encode it as a string, but rather store the bytes as an array.
JsonVisitor
Debug
PrettyVisitor go an overridden implementation to make the output more pretty.
PrettyVisitor
okay, i've enabled auto merge so this should merge once CI passes — let's merge master to pick up the Clippy fixes?
master
Motivation
Users may want to pass data to
Subscribe
s which is not valid UTF-8. Currently, it would have to be encoded into&str
to be passed as a field value.Solution
This branch adds a
record_byte_slice
method toVisit
. It has an implementation falling back torecord_debug
so it is not be a breaking change.JsonVisitor
got an overridden implementation as it should not useDebug
output and encode it as a string, but rather store the bytes as an array.PrettyVisitor
go an overridden implementation to make the output more pretty.