Fix clippy errors + lint, use turbo CI

This commit is contained in:
Jai A
2024-10-18 16:07:35 -07:00
parent 663ab83b08
commit 8dd955563e
186 changed files with 10615 additions and 6433 deletions

View File

@@ -112,7 +112,10 @@ impl ThreadBuilder {
}
impl Thread {
pub async fn get<'a, E>(id: ThreadId, exec: E) -> Result<Option<Thread>, sqlx::Error>
pub async fn get<'a, E>(
id: ThreadId,
exec: E,
) -> Result<Option<Thread>, sqlx::Error>
where
E: sqlx::Executor<'a, Database = sqlx::Postgres> + Copy,
{
@@ -130,7 +133,8 @@ impl Thread {
{
use futures::stream::TryStreamExt;
let thread_ids_parsed: Vec<i64> = thread_ids.iter().map(|x| x.0).collect();
let thread_ids_parsed: Vec<i64> =
thread_ids.iter().map(|x| x.0).collect();
let threads = sqlx::query!(
"
SELECT t.id, t.thread_type, t.mod_id, t.report_id,
@@ -225,7 +229,8 @@ impl ThreadMessage {
{
use futures::stream::TryStreamExt;
let message_ids_parsed: Vec<i64> = message_ids.iter().map(|x| x.0).collect();
let message_ids_parsed: Vec<i64> =
message_ids.iter().map(|x| x.0).collect();
let messages = sqlx::query!(
"
SELECT tm.id, tm.author_id, tm.thread_id, tm.body, tm.created, tm.hide_identity
@@ -261,7 +266,8 @@ impl ThreadMessage {
WHERE id = $1
",
id as ThreadMessageId,
serde_json::to_value(MessageBody::Deleted { private }).unwrap_or(serde_json::json!({}))
serde_json::to_value(MessageBody::Deleted { private })
.unwrap_or(serde_json::json!({}))
)
.execute(&mut **transaction)
.await?;