Skip to content
This repository has been archived by the owner on Aug 3, 2023. It is now read-only.

Fix some clippy warnings #793

Merged
merged 4 commits into from
Oct 22, 2019
Merged

Fix some clippy warnings #793

merged 4 commits into from
Oct 22, 2019

Conversation

EverlastingBugstopper
Copy link
Contributor

This PR removes the following clippy warnings:

warning: You checked before that `unwrap()` cannot fail. Instead of checking and unwrapping, it's better to use `if let` or `match`.
  --> src/commands/kv/bulk/delete.rs:44:20
   |
41 |             if keys_vec.is_err() {
   |                ----------------- the check is happening here
...
44 |                 Ok(keys_vec.unwrap())
   |                    ^^^^^^^^^^^^^^^^^
   |
   = note: `#[warn(clippy::unnecessary_unwrap)]` on by default
   = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_unwrap
warning: You checked before that `unwrap()` cannot fail. Instead of checking and unwrapping, it's better to use `if let` or `match`.
  --> src/commands/kv/bulk/put.rs:33:51
   |
30 |             if data_vec.is_err() {
   |                ----------------- the check is happening here
...
33 |                 let data_vec: Vec<KeyValuePair> = data_vec.unwrap();
   |                                                   ^^^^^^^^^^^^^^^^^
   |
   = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_unwrap
warning: writing `&Vec<_>` instead of `&[_]` involves one more reference and cannot be used with non-Vec-based slices.
  --> src/commands/kv/bulk/put.rs:65:12
   |
65 |     pairs: &Vec<KeyValuePair>,
   |            ^^^^^^^^^^^^^^^^^^ help: change this to: `&[KeyValuePair]`
   |
   = note: `#[warn(clippy::ptr_arg)]` on by default
   = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#ptr_arg
warning: this function has too many arguments (8/7)
  --> src/commands/kv/key/put.rs:17:1
   |
17 | / pub fn put(
18 | |     target: &Target,
19 | |     user: &GlobalUser,
20 | |     id: &str,
...  |
25 | |     expiration_ttl: Option<&str>,
26 | | ) -> Result<(), failure::Error> {
   | |_______________________________^
   |
   = note: `#[warn(clippy::too_many_arguments)]` on by default
   = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#too_many_arguments

@ashleygwilliams ashleygwilliams merged commit d547dee into master Oct 22, 2019
@delete-merged-branch delete-merged-branch bot deleted the avery/fix-clippy branch October 22, 2019 14:40
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants