Skip to content

Conversation

ephraimfeldblum
Copy link
Contributor

Maybe RedisKey::key_inner shouldn't be public in the general case, but it is required for a module that wants to call C fns expecting *RedisModuleKey given Rust structs.

…r a module that wants to call C fns given Rust structs
@ephraimfeldblum ephraimfeldblum requested a review from rafie October 23, 2022 12:27
@gkorland gkorland requested a review from iddm May 2, 2023 07:31
Copy link
Collaborator

@iddm iddm left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We also need to resolve the conflicts and rebase onto the latest master.

pub struct RedisKey {
ctx: *mut raw::RedisModuleCtx,
key_inner: *mut raw::RedisModuleKey,
pub key_inner: *mut raw::RedisModuleKey,
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I suggest we instead have a method to return it, rather than having it visible to everyone. Usually, such methods are called as_ptr and as_mut_ptr. I suggest we follow the conventional naming and leave this struct member private in favour of having a method.
I also didn't see where it was needed exactly and in what way. Perhaps, if there are examples of where it is needed, we could make it accessible in a more optimal way.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants