summaryrefslogtreecommitdiff
path: root/src/hitomezashi.rs
diff options
context:
space:
mode:
authorNicholas Johnson <nick@nicholasjohnson.ch>2024-04-19 00:00:00 +0000
committerNicholas Johnson <nick@nicholasjohnson.ch>2024-04-19 00:00:00 +0000
commit9bd537c6894ce02c8d9114154a05e90881d06820e27653246117752882a9179f (patch)
tree4c598af9bf5891f586bc13b018159c7c9917890fec1039ced9c8f3993f832c4d /src/hitomezashi.rs
parent0638f65020a40273eaaa4451a38ac859783bc4b8210c5305382374c2f8eaec3c (diff)
downloadhitomezashi-rs-9bd537c6894ce02c8d9114154a05e90881d06820e27653246117752882a9179f.tar.gz
hitomezashi-rs-9bd537c6894ce02c8d9114154a05e90881d06820e27653246117752882a9179f.zip
Move variable initialization
Diffstat (limited to 'src/hitomezashi.rs')
-rw-r--r--src/hitomezashi.rs4
1 files changed, 3 insertions, 1 deletions
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<f64>) {
// the first square (upper left corner) is always transparent
let init_bit: bool = true;
+
let mut row_bits: Vec<bool> = Vec::with_capacity(height - 1);
- let mut col_bits: Vec<bool> = Vec::with_capacity(width - 1);
for _ in 0..(height - 1) {
row_bits.push(brn.sample(&mut rng));
}
+ let mut col_bits: Vec<bool> = Vec::with_capacity(width - 1);
+
for _ in 0..(width - 1) {
col_bits.push(brn.sample(&mut rng));
}