diff --git a/src/tools/tidy/src/debug_artifacts.rs b/src/tools/tidy/src/debug_artifacts.rs index 4664e2ef9a51c..408be83b926e2 100644 --- a/src/tools/tidy/src/debug_artifacts.rs +++ b/src/tools/tidy/src/debug_artifacts.rs @@ -2,7 +2,7 @@ use std::path::{Path, PathBuf}; -const GRAPHVIZ_POSTFLOW_MSG: &'static str = "`borrowck_graphviz_postflow` attribute in test"; +const GRAPHVIZ_POSTFLOW_MSG: &str = "`borrowck_graphviz_postflow` attribute in test"; pub fn check(path: &Path, bad: &mut bool) { let test_dir: PathBuf = path.join("test"); diff --git a/src/tools/tidy/src/error_codes_check.rs b/src/tools/tidy/src/error_codes_check.rs index ebaa81d2a8dbe..428c57d3ee822 100644 --- a/src/tools/tidy/src/error_codes_check.rs +++ b/src/tools/tidy/src/error_codes_check.rs @@ -53,7 +53,7 @@ fn extract_error_codes(f: &str, error_codes: &mut HashMap, path: & error_codes.insert(err_code.clone(), false); } // Now we extract the tests from the markdown file! - let md = some_or_continue!(s.splitn(2, "include_str!(\"").skip(1).next()); + let md = some_or_continue!(s.splitn(2, "include_str!(\"").nth(1)); let md_file_name = some_or_continue!(md.splitn(2, "\")").next()); let path = some_or_continue!(path.parent()).join(md_file_name); match read_to_string(&path) { @@ -84,7 +84,7 @@ fn extract_error_codes_from_tests(f: &str, error_codes: &mut HashMap bool { } } } - return false; + false } pub fn collect_lang_features(base_src_path: &Path, bad: &mut bool) -> Features { @@ -344,7 +344,7 @@ fn collect_lang_features_in(base: &Path, file: &str, bad: &mut bool) -> Features } None } else { - let s = issue_str.split('(').nth(1).unwrap().split(')').nth(0).unwrap(); + let s = issue_str.split('(').nth(1).unwrap().split(')').next().unwrap(); Some(s.parse().unwrap()) }; Some((name.to_owned(), Feature { level, since, has_gate_test: false, tracking_issue })) diff --git a/src/tools/tidy/src/features/version.rs b/src/tools/tidy/src/features/version.rs index c8c39ad27e09f..620be2f985230 100644 --- a/src/tools/tidy/src/features/version.rs +++ b/src/tools/tidy/src/features/version.rs @@ -38,7 +38,7 @@ impl FromStr for Version { let parts = [part()?, part()?, part()?]; - if let Some(_) = iter.next() { + if iter.next().is_some() { // Ensure we don't have more than 3 parts. return Err(ParseVersionError::WrongNumberOfParts); } diff --git a/src/tools/tidy/src/style.rs b/src/tools/tidy/src/style.rs index b15c29921d2b2..4247fcb3b7f53 100644 --- a/src/tools/tidy/src/style.rs +++ b/src/tools/tidy/src/style.rs @@ -58,7 +58,7 @@ enum LIUState { fn line_is_url(columns: usize, line: &str) -> bool { // more basic check for error_codes.rs, to avoid complexity in implementing two state machines if columns == ERROR_CODE_COLS { - return line.starts_with("[") && line.contains("]:") && line.contains("http"); + return line.starts_with('[') && line.contains("]:") && line.contains("http"); } use self::LIUState::*;