mirror of
https://github.com/toeverything/AFFiNE.git
synced 2026-07-21 12:06:35 +08:00
style: run clippy fix and fmt (#9965)
This commit is contained in:
@@ -84,7 +84,7 @@ impl SqliteDocStorage {
|
||||
}
|
||||
|
||||
// Increment timestamp by 1ms and retry
|
||||
timestamp = timestamp + chrono::Duration::milliseconds(1);
|
||||
timestamp += chrono::Duration::milliseconds(1);
|
||||
tried += 1;
|
||||
}
|
||||
}
|
||||
@@ -102,7 +102,7 @@ impl SqliteDocStorage {
|
||||
let mut tx = self.pool.begin().await?;
|
||||
|
||||
sqlx::query(r#"INSERT INTO updates (doc_id, data, created_at) VALUES ($1, $2, $3);"#)
|
||||
.bind(&doc_id)
|
||||
.bind(doc_id)
|
||||
.bind(update.as_ref())
|
||||
.bind(timestamp)
|
||||
.execute(&mut *tx)
|
||||
@@ -114,7 +114,7 @@ impl SqliteDocStorage {
|
||||
ON CONFLICT(doc_id)
|
||||
DO UPDATE SET timestamp=$2;"#,
|
||||
)
|
||||
.bind(&doc_id)
|
||||
.bind(doc_id)
|
||||
.bind(timestamp)
|
||||
.execute(&mut *tx)
|
||||
.await?;
|
||||
@@ -293,7 +293,7 @@ mod tests {
|
||||
storage
|
||||
.set_doc_snapshot(DocRecord {
|
||||
doc_id: "test".to_string(),
|
||||
bin: vec![0, 0].into(),
|
||||
bin: vec![0, 0],
|
||||
timestamp: Utc::now().naive_utc(),
|
||||
})
|
||||
.await
|
||||
@@ -373,7 +373,7 @@ mod tests {
|
||||
|
||||
let snapshot = DocRecord {
|
||||
doc_id: "test".to_string(),
|
||||
bin: vec![0, 0].into(),
|
||||
bin: vec![0, 0],
|
||||
timestamp: Utc::now().naive_utc(),
|
||||
};
|
||||
|
||||
@@ -391,7 +391,7 @@ mod tests {
|
||||
|
||||
let snapshot = DocRecord {
|
||||
doc_id: "test".to_string(),
|
||||
bin: vec![0, 0].into(),
|
||||
bin: vec![0, 0],
|
||||
timestamp: Utc::now().naive_utc(),
|
||||
};
|
||||
|
||||
@@ -404,7 +404,7 @@ mod tests {
|
||||
|
||||
let snapshot = DocRecord {
|
||||
doc_id: "test".to_string(),
|
||||
bin: vec![0, 1].into(),
|
||||
bin: vec![0, 1],
|
||||
timestamp: DateTime::from_timestamp_millis(Utc::now().timestamp_millis() - 1000)
|
||||
.unwrap()
|
||||
.naive_utc(),
|
||||
|
||||
Reference in New Issue
Block a user