mirror of
https://github.com/starovoid/rxing.git
synced 2026-07-28 05:12:34 +00:00
cargo fmt
This commit is contained in:
@@ -117,7 +117,9 @@ impl From<&str> for BarcodeFormat {
|
||||
"datamatrix" | "data matrix" | "data_matrix" => BarcodeFormat::DATA_MATRIX,
|
||||
"ean 8" | "ean_8" | "ean8" => BarcodeFormat::EAN_8,
|
||||
"ean 13" | "ean_13" | "ean13" => BarcodeFormat::EAN_13,
|
||||
"itf" | "itf_code" | "itf14" | "itf 14" | "itf_14" | "interleaved 2 of 5"=> BarcodeFormat::ITF,
|
||||
"itf" | "itf_code" | "itf14" | "itf 14" | "itf_14" | "interleaved 2 of 5" => {
|
||||
BarcodeFormat::ITF
|
||||
}
|
||||
"maxicode" | "maxi_code" => BarcodeFormat::MAXICODE,
|
||||
"pdf 417" | "pdf_417" | "pdf417" => BarcodeFormat::PDF_417,
|
||||
"qrcode" | "qr_code" | "qr code" => BarcodeFormat::QR_CODE,
|
||||
@@ -125,7 +127,8 @@ impl From<&str> for BarcodeFormat {
|
||||
"rss expanded" | "expanded rss" | "rss_expanded" => BarcodeFormat::RSS_EXPANDED,
|
||||
"upc a" | "upc_a" | "upca" => BarcodeFormat::UPC_A,
|
||||
"upc e" | "upc_e" | "upce" => BarcodeFormat::UPC_E,
|
||||
"upc ean extension" | "upc extension" | "ean extension" | "upc/ean extension" | "upc_ean_extension"=> BarcodeFormat::UPC_EAN_EXTENSION,
|
||||
"upc ean extension" | "upc extension" | "ean extension" | "upc/ean extension"
|
||||
| "upc_ean_extension" => BarcodeFormat::UPC_EAN_EXTENSION,
|
||||
_ => BarcodeFormat::QR_CODE,
|
||||
}
|
||||
}
|
||||
|
||||
@@ -677,7 +677,11 @@ impl From<&BitMatrix> for image::DynamicImage {
|
||||
|
||||
for y in 0..value.height {
|
||||
for x in 0..value.width {
|
||||
pixels.put_pixel(x, y, image::Luma([if value.get(x, y) {u8::MIN} else {u8::MAX} ]));
|
||||
pixels.put_pixel(
|
||||
x,
|
||||
y,
|
||||
image::Luma([if value.get(x, y) { u8::MIN } else { u8::MAX }]),
|
||||
);
|
||||
}
|
||||
}
|
||||
pixels.into()
|
||||
|
||||
@@ -54,8 +54,10 @@ impl ReedSolomonEncoder {
|
||||
.multiply(
|
||||
&GenericGFPoly::new(
|
||||
self.field,
|
||||
&[1,
|
||||
self.field.exp(d as i32 - 1 + self.field.getGeneratorBase())],
|
||||
&[
|
||||
1,
|
||||
self.field.exp(d as i32 - 1 + self.field.getGeneratorBase()),
|
||||
],
|
||||
)
|
||||
.unwrap(),
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user