diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/lib.rs | 6 |
1 files changed, 3 insertions, 3 deletions
@@ -63,7 +63,7 @@ fn print_square(lock: &mut StdoutLock, is_opaque: bool) { /// ``` pub fn generate(width: usize, height: usize, skew: Option<f64>) { // skew=0.5 generates the most random-looking patterns - let skew: f64 = skew.unwrap_or(0.5); + let skew = skew.unwrap_or(0.5); assert!(width >= 1, "Width must be a positive number!"); assert!(height >= 1, "Height must be a positive number!"); @@ -92,7 +92,7 @@ pub fn generate(width: usize, height: usize, skew: Option<f64>) { // Precomputed values to facilitate alternating between stitch presence and stitch absence let mut alt_bits: Vec<bool> = Vec::with_capacity(width); - let mut alternator: bool = false; + let mut alternator = false; for _ in 0..alt_bits.capacity() { alt_bits.push(alternator); alternator = !alternator; @@ -101,7 +101,7 @@ pub fn generate(width: usize, height: usize, skew: Option<f64>) { /* The first square is always opaque to prevent invisible 1xN or Nx1 patterns. Invisible * patterns must be prevented so that users don't mistakenly conclude that the function does * not work. */ - let first_square: bool = true; + let first_square = true; let mut cur_row: Vec<bool> = Vec::with_capacity(width); |