valkey-io / valkeymodule-rs

Rust valkey SDK for modules
BSD 3-Clause "New" or "Revised" License
35 stars 10 forks source link

feat(digest): Digest wrappers #102

Open hahnandrew opened 1 month ago

hahnandrew commented 1 month ago

Adds rust wrappers for module APIs ValkeyModule_DigestAddStringBuffer, ValkeyModule_DigestAddLongLong, ValkeyModule_DigestEndSequence, ValkeyModule_GetKeyNameFromDigest, ValkeyModule_GetDbIdFromDigest

Adds callback for digest and integration test for alloc module

Closes #97

dmitrypol commented 2 weeks ago

hi @hahnandrew . Thank for submitting the PR. I am sorry it took me so long to get to it. Left a few comments.

dmitrypol commented 2 weeks ago

when I run test.sh (after adding missing }) I get

error[E0308]: mismatched types
   --> tests/integration.rs:791:20
    |
791 | fn test_debug() -> Result<()> {
    |    ----------      ^^^^^^^^^^ expected `Result<(), Error>`, found `()`

You need to add Ok(()) at the end

dmitrypol commented 2 weeks ago

also could you please run cargo fmt to format code nicely, I know it's a nitpick