Closed ivmarkov closed 6 months ago
Looks good to me. QR Code on console is anyway a 'developer workflow', unless some products want to print it on an attached display. At some point, we should also move to calling this from the application instead of the rs-matter/src/core/
.
The current QR gen uses internally two buffers which are really big: total size 10K+. And this is in addition to the need to supply an external buffer too.
After the changes, the QR gen does not allocate buffers on stack anymore, and works only with the single, externally-supplied buffer, which can be < 1000 bytes. Changes/improvements:
impl Iterator
pattern), and no longer needs any buffers. The only reason why we materialize the chars' stream temporarily into a&str
is because this is what the QR library we use expects, but given the short nature of the Matter QR strings, this is no longer an issue&str
(which we need for outputting withinfo!
- otherwise the graphics rendering was always streaming based too) is now done line-by-line, which significantly reduces the need for a large buffer.