소스 검색

compose/gpg.rs: Fix msrv regression

Signed-off-by: Manos Pitsidianakis <manos@pitsidianak.is>
Manos Pitsidianakis 7 달 전
부모
커밋
192ecea2
1개의 변경된 파일2개의 추가작업 그리고 1개의 파일을 삭제
  1. 2 1
      meli/src/mail/compose/gpg.rs

+ 2 - 1
meli/src/mail/compose/gpg.rs

@@ -183,10 +183,11 @@ impl Component for KeySelection {
                 {
                     let mut main_handle_ref = &mut (*main_handle);
                     let is_main = *id == main_handle_ref.job_id;
+                    let other_handle_ref_opt = other_handles.iter_mut().find(|h| h.job_id == *id);
                     let handle = if is_main {
                         &mut main_handle_ref
                     } else {
-                        &mut other_handles.iter_mut().find(|h| h.job_id == *id).unwrap()
+                        &mut (*other_handle_ref_opt.unwrap())
                     };
                     match handle.chan.try_recv() {
                         Err(_) => { /* Job was canceled */ }