mirror of
https://github.com/storytold/gridcraft.git
synced 2026-10-24 10:46:50 -06:00
style: satisfy cargo fmt and clippy on the fill-handle perf change
cargo fmt reformatted the new example's while-loop condition onto its own line; clippy's nonminimal_bool caught a negated is_some_and that reads more plainly as is_none_or. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Sonnet 5
parent
43a118c543
commit
e7d590c8a4
@@ -31,7 +31,8 @@ fn main() {
|
||||
let t = Instant::now();
|
||||
let mut last = 0u32;
|
||||
let mut iters = 0u64;
|
||||
while last + 1 < gridcraft_engine::core::MAX_ROWS && sh.value_ref(CellRef::new(last + 1, neighbour)).is_some_and(|v| !v.is_empty()) && last < cap {
|
||||
while last + 1 < gridcraft_engine::core::MAX_ROWS && sh.value_ref(CellRef::new(last + 1, neighbour)).is_some_and(|v| !v.is_empty()) && last < cap
|
||||
{
|
||||
last += 1;
|
||||
iters += 1;
|
||||
}
|
||||
|
||||
@@ -149,7 +149,7 @@ impl CellStore {
|
||||
let band_hi = ((band_key + 1) * BAND - 1).min(cap);
|
||||
let mut advanced = false;
|
||||
for (r, cols) in band.rows.range(expect..=band_hi) {
|
||||
if *r != expect || !cols.get(&from.col).is_some_and(|c| !c.value.is_empty()) {
|
||||
if *r != expect || cols.get(&from.col).is_none_or(|c| c.value.is_empty()) {
|
||||
return last;
|
||||
}
|
||||
last = Some(expect);
|
||||
|
||||
Reference in New Issue
Block a user