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: solve lint issues #704

Merged
merged 3 commits into from
Nov 3, 2022
Merged

fix: solve lint issues #704

merged 3 commits into from
Nov 3, 2022

Conversation

0xWOF
Copy link
Contributor

@0xWOF 0xWOF commented Nov 3, 2022

On rust 1.65.0, main branch of redis-rs can not pass lint workflow.
Solved issues is

  • explicit-auto-deref
  • bool-to-int-with-if
  • needless-borrow

@djc
Copy link
Contributor

djc commented Nov 3, 2022

Wow, that was quick! Thanks for cleaning these up!

@0xWOF
Copy link
Contributor Author

0xWOF commented Nov 3, 2022

it is weird that this PR is pass (7.0.0, nightly) test on my repository, but not on here.
https://github.com/0xWOF/redis-rs/actions/runs/3387016797/jobs/5627179494.

I think that it is timing issue of test code, if con.set is executed slowly on ci machine, it can do not pass the test.
How about your thoughts?

    let ctx = TestContext::new();
    let mut con = ctx.connection();

    let _: () = con.set("object_key_str", "object_value_str").unwrap();
    let _: () = con.set("object_key_int", 42).unwrap();

    assert_eq!(
        con.object_encoding::<_, String>("object_key_str").unwrap(),
        "embstr"
    );

    assert_eq!(
        con.object_encoding::<_, String>("object_key_int").unwrap(),
        "int"
    );

    assert_eq!(con.object_idletime::<_, i32>("object_key_str").unwrap(), 0); // do not pass here!

@djc djc merged commit 95a778d into redis-rs:main Nov 3, 2022
@djc
Copy link
Contributor

djc commented Nov 3, 2022

Looks like that test failed intermittently, since it worked on the second try.

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.

None yet

2 participants