Skip to content

Commit

Permalink
Merge pull request #10 from akx/improvements
Browse files Browse the repository at this point in the history
Small improvements
  • Loading branch information
hschimke authored Feb 8, 2024
2 parents 8d68592 + e4ad28c commit 96540ce
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/encode_hints.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
use rxing::{datamatrix::encoder::SymbolShapeHint, Dimension};
use std::collections::{HashMap, HashSet};
use std::collections::{HashMap};
use wasm_bindgen::prelude::*;

#[wasm_bindgen]
Expand Down
2 changes: 1 addition & 1 deletion src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -325,7 +325,7 @@ pub fn decode_barcode(
/// Such an object could be obtained using the `getImageData`
/// method of a `CanvasRenderingContext2D` object.
pub fn convert_js_image_to_luma(data: &[u8]) -> Vec<u8> {
let mut luma_data = Vec::new();
let mut luma_data = Vec::with_capacity(data.len() / 4);
for src_pixel in data.chunks_exact(4) {
let [red, green, blue, alpha] = src_pixel else {
continue;
Expand Down

0 comments on commit 96540ce

Please sign in to comment.