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,11 +69,13 @@ 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 {
dispatch.set(NewTransferState { if let Ok(rd) = RegionDisplay::try_from((ul.0, ul.1, br.0, br.1)) {
source_region: RegionDisplay::try_from((ul.0, ul.1, br.0, br.1)).expect(""), dispatch.set(NewTransferState {
destination_region: current.destination_region.clone(), source_region: rd,
interleave_x: current.interleave_x, destination_region: current.destination_region.clone(),
interleave_y: current.interleave_y }) interleave_x: current.interleave_x,
interleave_y: current.interleave_y })
}
} }
} }
}) })