mirror of
https://github.com/chatmail/core.git
synced 2026-05-01 20:36:31 +03:00
Simplify Sql.query_row_col function
Function `query_row` executes query and calls callback function to process row returned. Function query_row_col() is special case, that provides callback function, which returns value of one particular column of row, ignoring others. In all cases, that particular column was 0 (first and only column of query result), since there is no point to select more than one column with this function -- they are discarded anyway. This commit removes that redundancy, removing column number argument of query_row_col() function and adjusting call sites accordingly.
This commit is contained in:
@@ -146,7 +146,6 @@ impl Key {
|
||||
context,
|
||||
"SELECT public_key FROM keypairs WHERE addr=? AND is_default=1;",
|
||||
&[addr],
|
||||
0,
|
||||
)
|
||||
.and_then(|blob: Vec<u8>| Self::from_slice(&blob, KeyType::Public))
|
||||
}
|
||||
@@ -160,7 +159,6 @@ impl Key {
|
||||
context,
|
||||
"SELECT private_key FROM keypairs WHERE addr=? AND is_default=1;",
|
||||
&[self_addr.as_ref()],
|
||||
0,
|
||||
)
|
||||
.and_then(|blob: Vec<u8>| Self::from_slice(&blob, KeyType::Private))
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user