@erwanvivien The issue is here which is called from to_str because command_colors is initialized to an empty vector instead of a vector of 4 Nones
I don't know if the fix makes sense as I didn't look into your code too much but it seems to work and all the tests are passing. Adding to that, it would make sense to check for potential similar issues before merging this. I'm going to be offline for a bit but ai think you should be able to add commits to this, otherwise I'll make an update tonight if needed.
Testing
I added the following to svg.rs to test that the fix worked.
#[cfg(test)]
mod tests {
use crate::qr::QRBuilder;
use crate::convert::svg::SvgBuilder;
#[test]
fn test() {
let tmp = SvgBuilder::default();
let qrcode = QRBuilder::new("https://example.com/")
.build()
.unwrap();
tmp.to_str(&qrcode);
}
}
cargo t -F image,svg -- svg::tests
The test was failing with the same error as mentioned in #19 but it passed after the change I made.
This fixes #19.
Description
@erwanvivien The issue is here which is called from
to_str
becausecommand_colors
is initialized to an empty vector instead of a vector of 4None
sI don't know if the fix makes sense as I didn't look into your code too much but it seems to work and all the tests are passing. Adding to that, it would make sense to check for potential similar issues before merging this. I'm going to be offline for a bit but ai think you should be able to add commits to this, otherwise I'll make an update tonight if needed.
Testing
I added the following to
svg.rs
to test that the fix worked.The test was failing with the same error as mentioned in #19 but it passed after the change I made.