-
Notifications
You must be signed in to change notification settings - Fork 335
Refactoring #1226
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
base: master
Are you sure you want to change the base?
Refactoring #1226
Conversation
@@ -1740,22 +1696,11 @@ where | |||
pub fn json_clear<M: Manager>(manager: M, ctx: &Context, args: Vec<RedisString>) -> RedisResult { | |||
let mut args = args.into_iter().skip(1); | |||
let key = args.next_arg()?; | |||
let paths = args.try_fold::<_, _, Result<Vec<Path>, RedisError>>( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@iddm I believe this to be a bug. This try_fold
implies that multiple paths may be passed to JSON.CLEAR
, even though only the first will ever be used. And that if, for any path arg, if arg.try_as_str().is_err()
then the function shall return early. Even if there was a legal path that was passed. Whereas the documentation clearly states that, at most, one singular path may be passed.
If anything, I believe the args length should be checked, and if it is not correct, then return Err(WrongArity)
.
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #1226 +/- ##
==========================================
- Coverage 78.37% 77.31% -1.06%
==========================================
Files 14 14
Lines 3921 3518 -403
==========================================
- Hits 3073 2720 -353
+ Misses 848 798 -50 ☔ View full report in Codecov by Sentry. |
…the callbacks ever return such a construct
@ephraimfeldblum as we discussed. Please try to think how we can split this work to multiple smaller PR's which is easier to review. Make sure to have a detailed message that explain the changes. If there are some API changes, make sure to specify them and explain why it was done. Last, make sure to split bugs to separate PR's so it will be easier to cherrypick (if needed). |
Sure thing.
Almost none to external APIs. iirc, just regarding ownership to prevent having to clone unnecessarily.
Yep. Already removed from here. |
No description provided.