Use collect instead of from iter

This commit is contained in:
Dietrich 2021-06-14 12:46:44 +02:00 committed by Franz Dietrich
parent 0a23b786b0
commit 67439c1c49

View File

@ -79,7 +79,6 @@ pub struct QrGuard {
impl QrGuard {
fn new(code: &str) -> Self {
use std::iter::FromIterator;
log!("Generating new QrCode");
let svg = generate_qr_from_code(code);
@ -89,7 +88,7 @@ impl QrGuard {
let png_jsarray: JsValue = js_sys::Uint8Array::from(&png_vec[..]).into();
// the buffer has to be an array of arrays
let png_buffer = js_sys::Array::from_iter(std::array::IntoIter::new([png_jsarray]));
let png_buffer: js_sys::Array = std::array::IntoIter::new([png_jsarray]).collect();
let png_blob =
web_sys::Blob::new_with_buffer_source_sequence_and_options(&png_buffer, &properties)
.unwrap();