From 253ef19a4d9230031c5cbd1e8a56b5930758c3e0 Mon Sep 17 00:00:00 2001 From: Project Nayuki Date: Fri, 12 Nov 2021 03:31:18 +0000 Subject: [PATCH] Reformatted some Rust code so that the expressions surrounding `..` have no spaces around operators. --- rust/src/lib.rs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/rust/src/lib.rs b/rust/src/lib.rs index d21c090..f58d18d 100644 --- a/rust/src/lib.rs +++ b/rust/src/lib.rs @@ -529,7 +529,7 @@ impl QrCode { let mut k: usize = 0; for i in 0 .. numblocks { let datlen: usize = shortblocklen - blockecclen + usize::from(i >= numshortblocks); - let mut dat = data[k .. k + datlen].to_vec(); + let mut dat = data[k .. k+datlen].to_vec(); k += datlen; let ecc: Vec = QrCode::reed_solomon_compute_remainder(&dat, &rsdiv); if i < numshortblocks { @@ -665,8 +665,8 @@ impl QrCode { } // 2*2 blocks of modules having same color - for y in 0 .. size - 1 { - for x in 0 .. size - 1 { + for y in 0 .. size-1 { + for x in 0 .. size-1 { let color: bool = self.module(x, y); if color == self.module(x + 1, y) && color == self.module(x, y + 1) && @@ -701,7 +701,7 @@ impl QrCode { let numalign = i32::from(ver) / 7 + 2; let step: i32 = if ver == 32 { 26 } else {(i32::from(ver) * 4 + numalign * 2 + 1) / (numalign * 2 - 2) * 2}; - let mut result: Vec = (0 .. numalign - 1).map( + let mut result: Vec = (0 .. numalign-1).map( |i| self.size - 7 - i * step).collect(); result.push(6); result.reverse();