do not silently ingnore peerstate error in repl; in repl it is okay to panic/unwrap

This commit is contained in:
B. Petersen
2020-08-07 09:25:40 +02:00
committed by link2xt
parent a3ecbb3809
commit 35c250c705

View File

@@ -284,13 +284,14 @@ async fn log_contactlist(context: &Context, contacts: &[u32]) {
"addr unset"
}
);
if let Ok(peerstate) = Peerstate::from_addr(context, &addr).await {
if peerstate.is_some() && contact_id != 1 as libc::c_uint {
line2 = format!(
", prefer-encrypt={}",
peerstate.as_ref().unwrap().prefer_encrypt
);
}
let peerstate = Peerstate::from_addr(context, &addr)
.await
.expect("peerstate error");
if peerstate.is_some() && contact_id != 1 as libc::c_uint {
line2 = format!(
", prefer-encrypt={}",
peerstate.as_ref().unwrap().prefer_encrypt
);
}
println!("Contact#{}: {}{}", contact_id, line, line2);