fix: Typo in transfer validation

This commit is contained in:
Emilia Allison 2024-11-15 15:27:18 -06:00
parent 03d7f08e63
commit ad3bbd3649
Signed by: emilia
GPG Key ID: 05D5D1107E5100A1
1 changed files with 6 additions and 4 deletions

View File

@ -131,10 +131,8 @@ impl TransferRegion {
pub fn calculate_map(&self) -> Box<dyn Fn(Well) -> Option<Vec<Well>> + '_> { pub fn calculate_map(&self) -> Box<dyn Fn(Well) -> Option<Vec<Well>> + '_> {
// By validating first, we have a stronger guarantee that // By validating first, we have a stronger guarantee that
// this function will not panic. :) // this function will not panic. :)
// log::debug!("Validating: {:?}", self.validate());
if let Err(msg) = self.validate() { if let Err(msg) = self.validate() {
eprintln!("{}", msg); log::error!("{}\nThis transfer will be empty.", msg);
eprintln!("This transfer will be empty.");
return Box::new(|_| None); return Box::new(|_| None);
} }
@ -308,11 +306,15 @@ impl TransferRegion {
// log::debug!("s1.1: {}, max.1: {}", s1.1, source_max.1); // log::debug!("s1.1: {}, max.1: {}", s1.1, source_max.1);
return Err("Source region is out-of-bounds! (Too wide)"); return Err("Source region is out-of-bounds! (Too wide)");
} }
if il_dest == (0,0) {
return Err("Refusing to pool both dimensions in a rectangular transfer!\nPlease select a point in the destination plate.")
}
} }
Region::Custom(_) => return Ok(()), Region::Custom(_) => return Ok(()),
} }
if il_source.0 == 0 || il_dest.1 == 0 { if il_source.0 == 0 || il_source.1 == 0 {
return Err("Source interleave cannot be zero!"); return Err("Source interleave cannot be zero!");
} }