lintcheck: fix clippy warnings

This commit is contained in:
Matthias Krüger 2021-03-11 15:25:43 +01:00
parent b068b742ee
commit 528e464b4f
2 changed files with 8 additions and 2 deletions

View file

@ -2,7 +2,13 @@
name = "lintcheck"
version = "0.0.1"
authors = ["The Rust Clippy Developers"]
description = "tool to monitor impact of changes in Clippys lints on a part of the ecosystem"
readme = "README.md"
license = "MIT OR Apache-2.0"
repository = "https://github.com/rust-lang/rust-clippy"
categories = ["development-tools"]
edition = "2018"
publish = false
[dependencies]
clap = "2.33"

View file

@ -499,7 +499,7 @@ fn parse_json_message(json_message: &str, krate: &Crate) -> ClippyWarning {
// /home/matthias/.cargo/registry/src/github.com-1ecc6299db9ec823/syn-1.0.63/src/custom_keyword.rs
let path = PathBuf::from(file);
let mut piter = path.into_iter();
let mut piter = path.iter();
// consume all elements until we find ".cargo", so that "/home/matthias" is skipped
let _: Option<&OsStr> = piter.find(|x| x == &std::ffi::OsString::from(".cargo"));
// collect the remaining segments
@ -594,7 +594,7 @@ fn is_in_clippy_root() -> bool {
/// This function panics if the clippy binaries don't exist
/// or if lintcheck is executed from the wrong directory (aka none-repo-root)
pub fn main() {
// assert that we launch lintcheck from the repo root (via cargo dev-lintcheck)
// assert that we launch lintcheck from the repo root (via cargo lintcheck)
if !is_in_clippy_root() {
eprintln!("lintcheck needs to be run from clippys repo root!\nUse `cargo lintcheck` alternatively.");
std::process::exit(3);