mirror of
https://github.com/chatmail/core.git
synced 2026-05-08 09:26:29 +03:00
Use bail macro
This seems to be our standard way to do this.
This commit is contained in:
committed by
link2xt
parent
47a6e31047
commit
4508eced37
@@ -1,6 +1,6 @@
|
|||||||
//! Contacts module
|
//! Contacts module
|
||||||
|
|
||||||
use anyhow::{bail, ensure, format_err, Context as _, Error, Result};
|
use anyhow::{bail, ensure, format_err, Context as _, Result};
|
||||||
use async_std::path::PathBuf;
|
use async_std::path::PathBuf;
|
||||||
use deltachat_derive::{FromSql, ToSql};
|
use deltachat_derive::{FromSql, ToSql};
|
||||||
use itertools::Itertools;
|
use itertools::Itertools;
|
||||||
@@ -294,7 +294,7 @@ impl Contact {
|
|||||||
min_origin: Origin,
|
min_origin: Origin,
|
||||||
) -> Result<Option<u32>> {
|
) -> Result<Option<u32>> {
|
||||||
if addr.as_ref().is_empty() {
|
if addr.as_ref().is_empty() {
|
||||||
return Err(Error::msg("lookup_id_by_addr: empty address"));
|
bail!("lookup_id_by_addr: empty address");
|
||||||
}
|
}
|
||||||
|
|
||||||
let addr_normalized = addr_normalize(addr.as_ref());
|
let addr_normalized = addr_normalize(addr.as_ref());
|
||||||
|
|||||||
Reference in New Issue
Block a user