summaryrefslogtreecommitdiff
path: root/src/lib.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/lib.rs')
-rw-r--r--src/lib.rs6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/lib.rs b/src/lib.rs
index feba85f..b45cd54 100644
--- a/src/lib.rs
+++ b/src/lib.rs
@@ -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);