From 5ca7e4bd1da4dcd96d5c372e3217e55565460221 Mon Sep 17 00:00:00 2001 From: David Estes Date: Tue, 23 Jan 2024 20:47:45 -0700 Subject: [PATCH] fix: only return true from insert when key is updated --- recon/src/recon/sqlitestore.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/recon/src/recon/sqlitestore.rs b/recon/src/recon/sqlitestore.rs index 00700493d..d3098366b 100644 --- a/recon/src/recon/sqlitestore.rs +++ b/recon/src/recon/sqlitestore.rs @@ -179,9 +179,9 @@ where /// Returns true if the key was new. The value is always updated if included async fn insert(&mut self, item: ReconItem<'_, Self::Key>) -> Result { let mut tx = self.pool.writer().begin().await?; - let (new_key, new_val) = self.insert_item_int(&item, &mut tx).await?; + let (new_key, _new_val) = self.insert_item_int(&item, &mut tx).await?; tx.commit().await?; - Ok(new_key || new_val) + Ok(new_key) } /// Insert new keys into the key space.