Skip to content

Commit

Permalink
fix: only return true from insert when key is updated
Browse files Browse the repository at this point in the history
  • Loading branch information
dav1do committed Jan 24, 2024
1 parent f71ab6f commit 5ca7e4b
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions recon/src/recon/sqlitestore.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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<bool> {
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.
Expand Down

0 comments on commit 5ca7e4b

Please sign in to comment.