Tweaked some Rust code for clarity, without changing behavior.

This commit is contained in:
Project Nayuki 2017-10-23 04:11:50 +00:00
parent d9dca158e3
commit 6f5eccf2fc
2 changed files with 2 additions and 2 deletions

View File

@ -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!();

View File

@ -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}),