Skip to content

Examples produce clippy warnings #230

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

Closed
Nemo157 opened this issue May 16, 2019 · 1 comment
Closed

Examples produce clippy warnings #230

Nemo157 opened this issue May 16, 2019 · 1 comment

Comments

@Nemo157
Copy link
Contributor

Nemo157 commented May 16, 2019

Bug Report

Current Behavior

Examples currently output warnings when checked with clippy:

warning: this let-binding has unit value. Consider omitting `let msg =`
  --> examples/src/body_types.rs:30:5
   |
30 |     let msg = cx.body_json().await.client_err()?;
   |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
   |
note: lint level defined here
  --> examples/src/lib.rs:2:9
   |
2  | #![warn(clippy::all)]
   |         ^^^^^^^^^^^
   = note: #[warn(clippy::let_unit_value)] implied by #[warn(clippy::all)]
   = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#let_unit_value

warning: passing a unit value to a function
  --> examples/src/body_types.rs:32:23
   |
32 |     Ok(response::json(msg))
   |                       ^^^
   |
note: lint level defined here
  --> examples/src/lib.rs:2:9
   |
2  | #![warn(clippy::all)]
   |         ^^^^^^^^^^^
   = note: #[warn(clippy::unit_arg)] implied by #[warn(clippy::all)]
   = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unit_arg
help: if you intended to pass a unit value, use a unit literal instead
   |
32 |     Ok(response::json(()))
   |                       ^^

warning: this let-binding has unit value. Consider omitting `let msg =`
  --> examples/src/body_types.rs:37:5
   |
37 |     let msg = cx.body_form().await?;
   |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
   |
   = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#let_unit_value

warning: passing a unit value to a function
  --> examples/src/body_types.rs:39:20
   |
39 |     Ok(forms::form(msg))
   |                    ^^^
   |
   = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unit_arg
help: if you intended to pass a unit value, use a unit literal instead
   |
39 |     Ok(forms::form(()))
   |                    ^^

Expected behavior/code

High quality warning free code.

Additional context/Screenshots

#228 excludes the examples from being run under clippy in CI, once the warnings have been fixed they can be included back into the clippy build.

@Nemo157
Copy link
Contributor Author

Nemo157 commented May 21, 2019

Fixed by #249

@Nemo157 Nemo157 closed this as completed May 21, 2019
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

No branches or pull requests

1 participant