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

Wrong suggestion in identical conversion lint #4183

Closed
sigmaSd opened this issue Jun 7, 2019 · 1 comment
Closed

Wrong suggestion in identical conversion lint #4183

sigmaSd opened this issue Jun 7, 2019 · 1 comment

Comments

@sigmaSd
Copy link

sigmaSd commented Jun 7, 2019

Hi,
clippy 0.0.212 (265318d 2019-05-17)

code:

fn main() {}

fn _z(a: &std::path::Path) -> std::io::Result<()> {
    for _ in std::fs::read_dir(a)? {}
    Ok(())
}

clippy:

warning: identical conversion
 --> src/main.rs:4:14
  |
4 |     for _ in std::fs::read_dir(a)? {}
  |              ^^^^^^^^^^^^^^^^^^^^^ help: consider removing `std::fs::read_dir(a)?()`: `std::fs::read_dir(a)?`
  |
  = note: #[warn(clippy::identity_conversion)] on by default
  = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#identity_conversion

removing ? and using unwrap for example make the lint warning disappear as it should

@sigmaSd
Copy link
Author

sigmaSd commented Jun 7, 2019

duplicate #4133

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