no direct slice indexing
This commit is contained in:
parent
453ad9ed35
commit
949822f26c
|
@ -148,12 +148,14 @@ fn calculate_shading_for_wells(
|
||||||
x.volume += 5.0;
|
x.volume += 5.0;
|
||||||
x.color = PALETTE.get_ordered(transfer.id, ordered_ids);
|
x.color = PALETTE.get_ordered(transfer.id, ordered_ids);
|
||||||
} else {
|
} else {
|
||||||
well_infos
|
if let Some(mut wi) = well_infos.get_mut(
|
||||||
[(well.row - 1) as usize * columns as usize + (well.col - 1) as usize] =
|
(well.row - 1) as usize * columns as usize + (well.col - 1) as usize,
|
||||||
Some(WellInfo::new(
|
) {
|
||||||
|
*wi = Some(WellInfo::new(
|
||||||
5.0,
|
5.0,
|
||||||
PALETTE.get_ordered(transfer.id, ordered_ids),
|
PALETTE.get_ordered(transfer.id, ordered_ids),
|
||||||
));
|
));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -276,17 +278,20 @@ fn add_plate_sub(
|
||||||
};
|
};
|
||||||
if let Some(wells) = current_transfer_wells {
|
if let Some(wells) = current_transfer_wells {
|
||||||
for w in wells {
|
for w in wells {
|
||||||
let well_info = &mut well_infos[(w.0 - 1) * columns as usize + (w.1 - 1)];
|
if let Some(mut well_info) =
|
||||||
let volume = well_info.map(|x| x.volume).unwrap_or(0.0)
|
well_infos.get_mut((w.0 - 1) * columns as usize + (w.1 - 1))
|
||||||
+ current_transfer_state
|
{
|
||||||
.and_then(|x| x.lock().ok())
|
let volume = well_info.map(|x| x.volume).unwrap_or(0.0)
|
||||||
.map(|x| x.volume)
|
+ current_transfer_state
|
||||||
.unwrap_or(0.0);
|
.and_then(|x| x.lock().ok())
|
||||||
|
.map(|x| x.volume)
|
||||||
|
.unwrap_or(0.0);
|
||||||
|
|
||||||
*well_info = Some(WellInfo {
|
*well_info = Some(WellInfo {
|
||||||
color: [255.0, 255.0, 255.0],
|
color: [255.0, 255.0, 255.0],
|
||||||
volume: 1.0,
|
volume: 1.0,
|
||||||
})
|
})
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
well_infos
|
well_infos
|
||||||
|
|
Loading…
Reference in New Issue