From 8ddbd1c31c5cfc149e8b13e35eccdaeb58bb0da3 Mon Sep 17 00:00:00 2001 From: Ofek Shaltiel Date: Mon, 19 Aug 2024 16:07:57 +0300 Subject: [PATCH] add typed version for compact_list_if_needed --- src/typed.rs | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/src/typed.rs b/src/typed.rs index 8320a7b..5390825 100644 --- a/src/typed.rs +++ b/src/typed.rs @@ -4,7 +4,7 @@ use std::{borrow::Borrow, marker::PhantomData, sync::Arc}; use crate::{ insertion::{ReplaceStatus, SetStatus}, store::TYPED_NAMESPACE, - CandyStore, + CandyStore, ListCompactionParams, }; use crate::encodable::EncodableUuid; @@ -440,6 +440,19 @@ where self.store.owned_discard_list(list_key) } + /// Same as [CandyStore::compact_list_if_needed], but `list_key` is typed + pub fn compact_if_needed( + &self, + list_key: &Q, + params: ListCompactionParams, + ) -> Result + where + L: Borrow, + { + let list_key = Self::make_list_key(list_key); + self.store.compact_list_if_needed(&list_key, params) + } + /// Same as [CandyStore::push_to_list_head], but `list_key` is typed pub fn push_head( &self,