Fix unchecked try_from

This commit is contained in:
Emilia Allison 2023-05-22 13:29:19 -04:00
parent a294cffd50
commit 61ac574b70
Signed by: emilia
GPG Key ID: 7A3F8997BFE894E0
1 changed files with 7 additions and 5 deletions

View File

@ -69,13 +69,15 @@ pub fn SourcePlate(props: &SourcePlateProps) -> Html {
m_stat_handle.set(false); m_stat_handle.set(false);
if let Some(ul) = *m_start_handle { if let Some(ul) = *m_start_handle {
if let Some(br) = *m_end_handle { if let Some(br) = *m_end_handle {
if let Ok(rd) = RegionDisplay::try_from((ul.0, ul.1, br.0, br.1)) {
dispatch.set(NewTransferState { dispatch.set(NewTransferState {
source_region: RegionDisplay::try_from((ul.0, ul.1, br.0, br.1)).expect(""), source_region: rd,
destination_region: current.destination_region.clone(), destination_region: current.destination_region.clone(),
interleave_x: current.interleave_x, interleave_x: current.interleave_x,
interleave_y: current.interleave_y }) interleave_y: current.interleave_y })
} }
} }
}
}) })
}; };