mirror of
https://github.com/chatmail/core.git
synced 2026-04-23 00:16:34 +03:00
sql: cleanup usage of ToSql
Moved custom ToSql trait including Send + Sync from lib.rs to sql.rs. Replaced most params! and paramsv! macro usage with tuples. Replaced paramsv! and params_iterv! with params_slice!, because there is no need to construct a vector.
This commit is contained in:
@@ -31,7 +31,7 @@ impl Context {
|
||||
if update {
|
||||
transaction.execute(
|
||||
"UPDATE contacts SET param=? WHERE id=?",
|
||||
params![param.to_string(), contact_id],
|
||||
(param.to_string(), contact_id),
|
||||
)?;
|
||||
}
|
||||
Ok(update)
|
||||
@@ -61,7 +61,7 @@ impl ChatId {
|
||||
if update {
|
||||
transaction.execute(
|
||||
"UPDATE chats SET param=? WHERE id=?",
|
||||
params![param.to_string(), self],
|
||||
(param.to_string(), self),
|
||||
)?;
|
||||
}
|
||||
Ok(update)
|
||||
|
||||
Reference in New Issue
Block a user