diff --git a/packages/turso-sync-engine/src/lib.rs b/packages/turso-sync-engine/src/lib.rs index 9bafe9097..4b0f723c1 100644 --- a/packages/turso-sync-engine/src/lib.rs +++ b/packages/turso-sync-engine/src/lib.rs @@ -102,25 +102,25 @@ mod tests { } pub async fn connect(&self) -> Result { self.run_db_fn(self.db.as_ref().unwrap(), async move |coro, db| { - Ok(turso::Connection::create(db.connect(&coro).await?)) + Ok(turso::Connection::create(db.connect(coro).await?)) }) .await } pub async fn pull(&self) -> Result<()> { self.run_db_fn(self.db.as_ref().unwrap(), async move |coro, db| { - db.pull(&coro).await + db.pull(coro).await }) .await } pub async fn push(&self) -> Result<()> { self.run_db_fn(self.db.as_ref().unwrap(), async move |coro, db| { - db.push(&coro).await + db.push(coro).await }) .await } pub async fn sync(&self) -> Result<()> { self.run_db_fn(self.db.as_ref().unwrap(), async move |coro, db| { - db.sync(&coro).await + db.sync(coro).await }) .await } diff --git a/packages/turso-sync-engine/src/test_protocol_io.rs b/packages/turso-sync-engine/src/test_protocol_io.rs index 18b4e9361..eaef3b6bb 100644 --- a/packages/turso-sync-engine/src/test_protocol_io.rs +++ b/packages/turso-sync-engine/src/test_protocol_io.rs @@ -17,6 +17,7 @@ use crate::{ #[derive(Clone)] pub struct TestProtocolIo { + #[allow(clippy::type_complexity)] pub requests: Arc>>>>>, pub server: TestSyncServer, ctx: Arc, @@ -39,6 +40,12 @@ pub struct TestDataCompletion { poisoned: Arc>>, } +impl Default for TestDataCompletion { + fn default() -> Self { + Self::new() + } +} + impl TestDataCompletion { pub fn new() -> Self { Self { @@ -76,7 +83,7 @@ impl DataCompletion for TestDataCompletion { "status error: {poison:?}" ))); } - Ok(self.status.lock().unwrap().clone()) + Ok(*self.status.lock().unwrap()) } fn poll_data(&self) -> Result> { @@ -87,7 +94,7 @@ impl DataCompletion for TestDataCompletion { ))); } let mut chunks = self.chunks.lock().unwrap(); - Ok(chunks.pop_front().map(|x| TestDataPollResult(x))) + Ok(chunks.pop_front().map(TestDataPollResult)) } fn is_done(&self) -> Result { @@ -179,7 +186,7 @@ impl ProtocolIO for TestProtocolIo { .await }); } - _ => panic!("unexpected sync server request: {} {:?}", method, path), + _ => panic!("unexpected sync server request: {method} {path:?}"), }; } Ok(completion) diff --git a/packages/turso-sync-engine/src/test_sync_server.rs b/packages/turso-sync-engine/src/test_sync_server.rs index e7c5dac69..ccfbc1eb6 100644 --- a/packages/turso-sync-engine/src/test_sync_server.rs +++ b/packages/turso-sync-engine/src/test_sync_server.rs @@ -213,7 +213,7 @@ impl TestSyncServer { session.in_txn = true; } let frame = &frames[offset..offset + FRAME_SIZE]; - match session.conn.wal_insert_frame(frame_no as u64, frame) { + match session.conn.wal_insert_frame(frame_no, frame) { Ok(info) => { if info.is_commit_frame() { if session.in_txn {