Switch to match

Will be needed to implement replicate transfers
This commit is contained in:
Emilia Allison 2023-05-13 11:57:18 -04:00
parent 1501651844
commit f5ba580e73
Signed by: emilia
GPG Key ID: 7A3F8997BFE894E0
1 changed files with 5 additions and 4 deletions

View File

@ -86,8 +86,8 @@ impl TransferRegion<'_> {
// then we *will* have injectivity. // then we *will* have injectivity.
// Non-replicate transfers: // Non-replicate transfers:
if let Region::Point((x,y)) = self.dest_region { match self.dest_region {
return Box::new(move |(i,j)| { Region::Point((x,y)) => return Box::new(move |(i,j)| {
if source_wells.contains(&(i,j)) { if source_wells.contains(&(i,j)) {
let il_source = self.interleave_source.unwrap_or((1,1)); let il_source = self.interleave_source.unwrap_or((1,1));
// Validity here already checked by self.validate() // Validity here already checked by self.validate()
@ -100,9 +100,10 @@ impl TransferRegion<'_> {
.mul(il_dest.1.abs() as u8), .mul(il_dest.1.abs() as u8),
)) ))
} else { None } } else { None }
}),
Region::Rect(c1, c2) => return Box::new(move |(i,j)| {
None
}) })
} else {
return Box::new(move |(_,_)| None)
} }
} }