sim: Simplify some struct initializers
In rust, if a struct field is initialized with a variable with the same
name as the field, it is redundant to say `field: field` as the
initializer, and just `field` is sufficient. Fix the instances of this
that clippy suggests.
Signed-off-by: David Brown <david.brown@linaro.org>
diff --git a/sim/simflash/src/lib.rs b/sim/simflash/src/lib.rs
index fa83c3e..dad0bca 100644
--- a/sim/simflash/src/lib.rs
+++ b/sim/simflash/src/lib.rs
@@ -107,11 +107,11 @@
SimFlash {
data: vec![erased_val; total],
write_safe: vec![true; total],
- sectors: sectors,
+ sectors,
bad_region: Vec::new(),
- align: align,
+ align,
verify_writes: true,
- erased_val: erased_val,
+ erased_val,
}
}
@@ -295,9 +295,9 @@
let base = self.base;
self.base += size;
Some(Sector {
- num: num,
- base: base,
- size: size,
+ num,
+ base,
+ size,
})
}
}