From cbe8c0ac2e020cd1ccbf645084f8ea469530d6aa Mon Sep 17 00:00:00 2001 From: Axel Viala Date: Fri, 2 Sep 2022 16:22:53 +0200 Subject: [PATCH 1/2] clippy --fix + cargo fmt pass. --- tests/code_checkers/docs.rs | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/tests/code_checkers/docs.rs b/tests/code_checkers/docs.rs index 918e64bb0..bc4aa06f2 100644 --- a/tests/code_checkers/docs.rs +++ b/tests/code_checkers/docs.rs @@ -21,14 +21,9 @@ fn to_correct_name(s: &str) -> String { } fn check_md_doc_path(p: &Path, md_line: &str, ty_line: &str) -> bool { - let parts = md_line.split("/").collect::>(); + let parts = md_line.split('/').collect::>(); if let Some(md_name) = parts.last().and_then(|n| n.split(".md").next()) { - if let Some(name) = ty_line - .split_whitespace() - .filter(|s| !s.is_empty()) - .skip(2) - .next() - { + if let Some(name) = ty_line.split_whitespace().filter(|s| !s.is_empty()).nth(2) { if let Some(name) = name .split('<') .next() @@ -54,7 +49,7 @@ fn check_md_doc_path(p: &Path, md_line: &str, ty_line: &str) -> bool { } else { show_error(p, &format!("Cannot extract md name from `{}`", md_line)); } - return false; + false } fn check_doc_comments_before(p: &Path, lines: &[&str], start: usize) -> bool { From 1ef226b825a28894309291722a4abd03e98ca1ae Mon Sep 17 00:00:00 2001 From: Axel Viala Date: Fri, 2 Sep 2022 17:19:43 +0200 Subject: [PATCH 2/2] Add clippy::needless-borrow catched by CI. --- src/linux/process.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/linux/process.rs b/src/linux/process.rs index adfa629e8..3da50d30c 100644 --- a/src/linux/process.rs +++ b/src/linux/process.rs @@ -653,7 +653,7 @@ fn get_uid_and_gid(file_path: &Path) -> Option<(uid_t, gid_t)> { } } - let status_data = get_all_data(&file_path, 16_385).ok()?; + let status_data = get_all_data(file_path, 16_385).ok()?; // We're only interested in the lines starting with Uid: and Gid: // here. From these lines, we're looking at the second entry to get