cf81a3b6d0
Implement "Use last" lint Closes #3673 This lint checks the use of `x.get(x.len() - 1)` and suggests `x.last()` (where `x` is a `Vec`). There's at least one more thing that needs to happen here. I believe I am correctly checking most of the scenarios and avoiding false positives. However, if different `Vec`s are used for the `x.get` and `y.len`, then it will emit a false positive. In other words, I need to check to make sure the `Vec`s are the same. Also, a lot of these commits were temporary and not helpful to the project history...am I supposed to squash on merge? If so, how do I do that? changelog: New lint: `get_last_with_len` |
||
---|---|---|
.. | ||
src | ||
Cargo.toml | ||
README.md |