mirror of
https://github.com/chatmail/core.git
synced 2026-04-23 00:16:34 +03:00
refactor(sql): add query_map_vec()
This also replaces some cases where flatten() was used, effectively ignoring the errors.
This commit is contained in:
@@ -630,7 +630,7 @@ async fn lookup_cache(
|
||||
let mut res = Vec::new();
|
||||
for cached_address in context
|
||||
.sql
|
||||
.query_map(
|
||||
.query_map_vec(
|
||||
"SELECT dns_cache.address
|
||||
FROM dns_cache
|
||||
LEFT JOIN connection_history
|
||||
@@ -647,10 +647,6 @@ async fn lookup_cache(
|
||||
let address: String = row.get(0)?;
|
||||
Ok(address)
|
||||
},
|
||||
|rows| {
|
||||
rows.collect::<std::result::Result<Vec<String>, _>>()
|
||||
.map_err(Into::into)
|
||||
},
|
||||
)
|
||||
.await?
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user