Remove dead code

This commit is contained in:
Emilia Allison 2023-05-13 11:53:04 -04:00
parent a31c40a1a0
commit f6045743e6
Signed by: emilia
GPG Key ID: 7A3F8997BFE894E0
1 changed files with 8 additions and 1 deletions

View File

@ -65,10 +65,17 @@ impl TransferRegion<'_> {
}
pub fn calculate_map(&self) -> Box<dyn Fn((u8,u8)) -> Option<(u8,u8)> + '_> {
// By validating first, we have a stronger guarantee that
// this function will not panic. :)
if let Err(msg) = self.validate() {
eprintln!("{}", msg);
eprintln!("This transfer will be empty.");
return Box::new(|(_,_)| None)
}
let source_wells = self.get_source_wells();
let il_dest = self.interleave_dest.unwrap_or((1,1));
let il_source = self.interleave_source.unwrap_or((1,1));
let source_corners: ((u8,u8),(u8,u8)) = self.source_region.try_into()
.expect("Source region should not be a point");