From 9bd537c6894ce02c8d9114154a05e90881d06820e27653246117752882a9179f Mon Sep 17 00:00:00 2001 From: Nicholas Johnson Date: Fri, 19 Apr 2024 00:00:00 +0000 Subject: Move variable initialization --- src/hitomezashi.rs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'src/hitomezashi.rs') diff --git a/src/hitomezashi.rs b/src/hitomezashi.rs index 88ba387..e8d4a65 100644 --- a/src/hitomezashi.rs +++ b/src/hitomezashi.rs @@ -36,13 +36,15 @@ pub fn hitomezashi(width: usize, height: usize, skew: Option) { // the first square (upper left corner) is always transparent let init_bit: bool = true; + let mut row_bits: Vec = Vec::with_capacity(height - 1); - let mut col_bits: Vec = Vec::with_capacity(width - 1); for _ in 0..(height - 1) { row_bits.push(brn.sample(&mut rng)); } + let mut col_bits: Vec = Vec::with_capacity(width - 1); + for _ in 0..(width - 1) { col_bits.push(brn.sample(&mut rng)); } -- cgit v1.2.3