Skip to content

Commit

Permalink
Remove unused redis hashmap
Browse files Browse the repository at this point in the history
  • Loading branch information
amirRamirfatahi committed Jan 22, 2025
1 parent d4bc8f2 commit a2016e5
Show file tree
Hide file tree
Showing 3 changed files with 0 additions and 136 deletions.
69 changes: 0 additions & 69 deletions src/db/kv/index/hashmap.rs

This file was deleted.

1 change: 0 additions & 1 deletion src/db/kv/index/mod.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
/// Module for redis Indexing operations split into modules by Redis types
pub mod hashmap;
pub mod json;
pub mod lists;
pub mod sets;
Expand Down
66 changes: 0 additions & 66 deletions src/db/kv/traits.rs
Original file line number Diff line number Diff line change
Expand Up @@ -679,70 +679,4 @@ pub trait RedisOps: Serialize + DeserializeOwned + Send + Sync {
let key = key_parts.join(":");
sorted_sets::get_lex_range("Sorted", &key, min, max, skip, limit).await
}

/// Puts multiple values into a hashmap in Redis.
///
/// # Arguments
///
/// * `key_parts` - A slice of string slices used to form the key under which the value is stored.
/// * `values` - A vector of tuples containing the field and value to be stored.
///
/// # Errors
///
/// Returns an error if the operation fails.
///
/// # Returns
///
/// Returns a `Result` indicating success or failure.
async fn put_index_hashmap(
key_parts: &[&str],
values: &[(&str, &str)],
) -> Result<(), DynError> {
let prefix = Self::prefix().await;
let key = key_parts.join(":");
hashmap::put_index_hashmap(&prefix, &key, values).await
}

/// Gets a value from a hashmap in Redis.
///
/// # Arguments
///
/// * `key_parts` - A slice of string slices used to form the key under which the value is stored.
/// * `field` - A string slice representing the field to retrieve from the hashmap.
///
/// # Returns
///
/// Returns an `Option<String>` containing the value if it exists, or `None` if the field does not exist.
///
/// # Errors
///
/// Returns an error if the operation fails.
async fn try_from_index_hashmap(
key_parts: &[&str],
field: &str,
) -> Result<Option<String>, DynError> {
let prefix = Self::prefix().await;
let key = key_parts.join(":");
hashmap::get_index_hashmap(&prefix, &key, field).await
}

/// Deletes a field from a hashmap in Redis.
///
/// # Arguments
///
/// * `key_parts` - A slice of string slices used to form the key under which the value is stored.
/// * `field` - A string slice representing the field to delete from the hashmap.
///
/// # Returns
///
/// Returns a `Result` indicating success or failure.
///
/// # Errors
///
/// Returns an error if the operation fails.
async fn remove_from_index_hashmap(key_parts: &[&str], field: &str) -> Result<(), DynError> {
let prefix = Self::prefix().await;
let key = key_parts.join(":");
hashmap::del_index_hashmap(&prefix, &key, field).await
}
}

0 comments on commit a2016e5

Please sign in to comment.