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 identity_conversion #4207

Closed
Geobert opened this issue Jun 14, 2019 · 1 comment
Closed

wrong identity_conversion #4207

Geobert opened this issue Jun 14, 2019 · 1 comment

Comments

@Geobert
Copy link

Geobert commented Jun 14, 2019

clippy 0.0.212 (265318d 2019-05-17)

I might be wrong, but it seems there's an issue here:

fn walk_dir(path: &Path) -> std::io::Result<()> {
    for entry in path.read_dir()? {
        if let Ok(entry) = entry {
            if entry.path().is_file() {
                do_stuff_on_file(&entry.path())?;
            } else if entry.path().is_dir() {
                walk_dir(&entry.path())?;
            }
        }
    }
    Ok(())
}
warning: identical conversion
  --> src\main.rs:41:18
   |
41 |     for entry in path.read_dir()? {
   |                  ^^^^^^^^^^^^^^^^ help: consider removing `path.read_dir()?()`: `path.read_dir()?`
   |
   = 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
@Geobert
Copy link
Author

Geobert commented Jun 14, 2019

my bad
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