From 6f5eccf2fc1867788068023a1d7ede6d8f240719 Mon Sep 17 00:00:00 2001 From: Project Nayuki Date: Mon, 23 Oct 2017 04:11:50 +0000 Subject: [PATCH] Tweaked some Rust code for clarity, without changing behavior. --- rust/examples/qrcodegen-demo.rs | 2 +- rust/src/lib.rs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/rust/examples/qrcodegen-demo.rs b/rust/examples/qrcodegen-demo.rs index 0dcd906..477d61e 100644 --- a/rust/examples/qrcodegen-demo.rs +++ b/rust/examples/qrcodegen-demo.rs @@ -166,7 +166,7 @@ fn print_qr(qr: &QrCode) { let border: i32 = 4; for y in -border .. qr.size() + border { for x in -border .. qr.size() + border { - let c: char = if qr.get_module(x, y) { '\u{2588}' } else { ' ' }; + let c: char = if qr.get_module(x, y) { '█' } else { ' ' }; print!("{0}{0}", c); } println!(); diff --git a/rust/src/lib.rs b/rust/src/lib.rs index f2cc055..3b1c9c9 100644 --- a/rust/src/lib.rs +++ b/rust/src/lib.rs @@ -770,7 +770,7 @@ impl ReedSolomonGenerator { fn new(degree: usize) -> ReedSolomonGenerator { assert!(1 <= degree && degree <= 255, "Degree out of range"); // Start with the monomial x^0 - let mut coefs = vec![0; degree - 1]; + let mut coefs = vec![0u8; degree - 1]; coefs.push(1); // Compute the product polynomial (x - r^0) * (x - r^1) * (x - r^2) * ... * (x - r^{degree-1}),