Seeking your support which I have illogical mismatched types
in our project.
Project built by docker compose up
. Actually images working fine from 3-4 months without issues; but now it shows error as illustrated below.
Sample Error (Note it is happened many times):
error[E0308]: mismatched types
--> db/src/pg/user_profiles.rs:158:27
|
158 | &[&is_worker, &*user_id],
| ^^^^^^^^^ expected `bool`, found `i64`
|
= note: expected reference `&bool`
found reference `&i64`
Code snippet for this error as below:
pub struct UserId(pub i64);
pub async fn update_is_worker(user_id: UserId, is_worker: bool) -> Result<()> {
let client = PG_POOL.get().await?;
let stmt = client
.prepare_typed(
"\
UPDATE user_profiles \
SET \
is_worker = $1 \
WHERE user_id = $2;\
",
&[Type::BOOL, Type::INT8],
)
.await?;
client.execute(&stmt, &[&is_worker, &*user_id]).await?;
Ok(())
}