Skip to content

Commit

Permalink
chore: delete and rename various files
Browse files Browse the repository at this point in the history
  • Loading branch information
HatemMn committed Dec 2, 2024
1 parent a2bb2b4 commit 25ea96b
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 11 deletions.
2 changes: 1 addition & 1 deletion src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ pub use findex::Findex;
#[cfg(feature = "bench")]
pub use memory::in_memory_store::InMemory;
#[cfg(feature = "redis-mem")]
pub use memory::redis_store::RedisStore;
pub use memory::redis_store::RedisMemory;
pub use secret::Secret;
#[cfg(feature = "test-utils")]
pub use test::memory::{
Expand Down
4 changes: 0 additions & 4 deletions src/memory/db_stores/mod.rs

This file was deleted.

12 changes: 6 additions & 6 deletions src/memory/redis_store.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ use super::error::MemoryError;
use crate::MemoryADT;

#[derive(Clone)]
pub struct RedisStore<Address: Hash + Eq, const WORD_LENGTH: usize> {
pub struct RedisMemory<Address: Hash + Eq, const WORD_LENGTH: usize> {
manager: ConnectionManager,
script_hash: String,
_marker_adr: PhantomData<Address>,
Expand Down Expand Up @@ -40,7 +40,7 @@ end
return value
";

impl<Address: Hash + Eq, const WORD_LENGTH: usize> Debug for RedisStore<Address, WORD_LENGTH> {
impl<Address: Hash + Eq, const WORD_LENGTH: usize> Debug for RedisMemory<Address, WORD_LENGTH> {
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
f.debug_struct("RedisMemory")
.field("connection", &"<redis::Connection>")
Expand All @@ -49,7 +49,7 @@ impl<Address: Hash + Eq, const WORD_LENGTH: usize> Debug for RedisStore<Address,
}
}

impl<Address: Hash + Eq, const WORD_LENGTH: usize> RedisStore<Address, WORD_LENGTH> {
impl<Address: Hash + Eq, const WORD_LENGTH: usize> RedisMemory<Address, WORD_LENGTH> {
/// Connects to a Redis server with a `ConnectionManager`.
pub async fn connect_with_manager(manager: ConnectionManager) -> Result<Self, MemoryError> {
Ok(Self {
Expand Down Expand Up @@ -81,7 +81,7 @@ impl<
Address: Send + Sync + Hash + Eq + Debug + Clone + Deref<Target = [u8; ADDRESS_LENGTH]>,
const ADDRESS_LENGTH: usize,
const WORD_LENGTH: usize,
> MemoryADT for RedisStore<Address, WORD_LENGTH>
> MemoryADT for RedisMemory<Address, WORD_LENGTH>
{
type Address = Address;
type Error = MemoryError;
Expand Down Expand Up @@ -149,8 +149,8 @@ mod tests {
const ADR_WORD_LENGTH: usize = 16;

async fn init_test_redis_db()
-> Result<RedisStore<Address<ADR_WORD_LENGTH>, ADR_WORD_LENGTH>, MemoryError> {
RedisStore::<Address<ADR_WORD_LENGTH>, ADR_WORD_LENGTH>::connect(&get_redis_url()).await
-> Result<RedisMemory<Address<ADR_WORD_LENGTH>, ADR_WORD_LENGTH>, MemoryError> {
RedisMemory::<Address<ADR_WORD_LENGTH>, ADR_WORD_LENGTH>::connect(&get_redis_url()).await
}

#[tokio::test]
Expand Down

0 comments on commit 25ea96b

Please sign in to comment.