Skip to content

Commit

Permalink
chore: combine phantom data
Browse files Browse the repository at this point in the history
  • Loading branch information
HatemMn committed Jan 21, 2025
1 parent ce6da6e commit e1669d3
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions src/memory/redis_store.rs
Original file line number Diff line number Diff line change
Expand Up @@ -50,8 +50,7 @@ impl From<RedisError> for MemoryError {
pub struct RedisMemory<Address, Word> {
manager: ConnectionManager,
script_hash: String,
a: PhantomData<Address>, // to ensure type checking despite that Address is intentionally unused in fields
w: PhantomData<Word>, // same as Address
_marker: PhantomData<(Address, Word)>, // to ensure type checking despite that Address & Word are intentionally unused in fields
}

impl<Address, Word> fmt::Debug for RedisMemory<Address, Word> {
Expand All @@ -74,8 +73,7 @@ impl<Address: Sync, Word: Sync> RedisMemory<Address, Word> {
Ok(Self {
manager,
script_hash,
a: PhantomData,
w: PhantomData,
_marker: PhantomData,
})
}

Expand Down

0 comments on commit e1669d3

Please sign in to comment.