Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix set expire (replace push_integer by push_bulk) #116

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

YunoL
Copy link

@YunoL YunoL commented Mar 10, 2023

Fixes set expire

Copy link
Collaborator

@Darksonn Darksonn left a comment

Choose a reason for hiding this comment

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

Can you please elaborate on the motivation behind this change? Did you test it with push_int and find that it doesn't work?

@YunoL
Copy link
Author

YunoL commented Mar 11, 2023

yes, the exemple provided in https://docs.rs/mini-redis/latest/mini_redis/blocking_client/struct.BlockingClient.html#method.set_expires produice
thread 'main' panicked at 'called `Result::unwrap()` on an `Err` value: "ERR Protocol error: expected '$', got ':'"', src/main.rs:9:50 note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
when i test it

@Darksonn
Copy link
Collaborator

I'm unable to reproduce that myself, though the assert!(val.is_some()); seems like it should test for .is_none() instead. How are you testing this?

Can you include the output with RUST_BACKTRACE=1?

@YunoL
Copy link
Author

YunoL commented Mar 11, 2023

I created a repo to reproduce the error: https://github.com/YunoL/set_expire, the panic come from client.set_expires("foo", "bar".into(), ttl).unwrap();

here is the backtrace:

RUST_BACKTRACE=1 cargo run
    Finished dev [unoptimized + debuginfo] target(s) in 0.02s
     Running `target/debug/test_redis`
thread 'main' panicked at 'called `Result::unwrap()` on an `Err` value: "ERR Protocol error: expected '$', got ':'"', src/main.rs:9:50
stack backtrace:
   0: rust_begin_unwind
             at /rustc/d5a82bbd26e1ad8b7401f6a718a9c57c96905483/library/std/src/panicking.rs:575:5
   1: core::panicking::panic_fmt
             at /rustc/d5a82bbd26e1ad8b7401f6a718a9c57c96905483/library/core/src/panicking.rs:64:14
   2: core::result::unwrap_failed
             at /rustc/d5a82bbd26e1ad8b7401f6a718a9c57c96905483/library/core/src/result.rs:1791:5
   3: core::result::Result<T,E>::unwrap
             at /rustc/d5a82bbd26e1ad8b7401f6a718a9c57c96905483/library/core/src/result.rs:1113:23
   4: test_redis::main
             at ./src/main.rs:9:5
   5: core::ops::function::FnOnce::call_once
             at /rustc/d5a82bbd26e1ad8b7401f6a718a9c57c96905483/library/core/src/ops/function.rs:507:5
note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace.

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.

2 participants