diff options
| author | flip1995 <hello@philkrones.com> | 2022-10-23 15:18:45 +0200 |
|---|---|---|
| committer | flip1995 <hello@philkrones.com> | 2022-10-23 15:18:45 +0200 |
| commit | cd0bb7de01d6f516c2e69c03f3bed26aaf167bc8 (patch) | |
| tree | 4ed3338886b744fc7e1dde203f9cebc9af3f73d1 /clippy_dev/src/setup | |
| parent | 2ed404937f2e9fcd481c717ef4d386d053ea59e3 (diff) | |
| download | rust-cd0bb7de01d6f516c2e69c03f3bed26aaf167bc8.tar.gz rust-cd0bb7de01d6f516c2e69c03f3bed26aaf167bc8.zip | |
Merge commit '4f142aa1058f14f153f8bfd2d82f04ddb9982388' into clippyup
Diffstat (limited to 'clippy_dev/src/setup')
| -rw-r--r-- | clippy_dev/src/setup/intellij.rs | 17 |
1 files changed, 5 insertions, 12 deletions
diff --git a/clippy_dev/src/setup/intellij.rs b/clippy_dev/src/setup/intellij.rs index b64e79733eb..efdb158c21e 100644 --- a/clippy_dev/src/setup/intellij.rs +++ b/clippy_dev/src/setup/intellij.rs @@ -36,9 +36,8 @@ impl ClippyProjectInfo { } pub fn setup_rustc_src(rustc_path: &str) { - let rustc_source_dir = match check_and_get_rustc_dir(rustc_path) { - Ok(path) => path, - Err(_) => return, + let Ok(rustc_source_dir) = check_and_get_rustc_dir(rustc_path) else { + return }; for project in CLIPPY_PROJECTS { @@ -172,14 +171,10 @@ pub fn remove_rustc_src() { } fn remove_rustc_src_from_project(project: &ClippyProjectInfo) -> bool { - let mut cargo_content = if let Ok(content) = read_project_file(project.cargo_file) { - content - } else { + let Ok(mut cargo_content) = read_project_file(project.cargo_file) else { return false; }; - let section_start = if let Some(section_start) = cargo_content.find(RUSTC_PATH_SECTION) { - section_start - } else { + let Some(section_start) = cargo_content.find(RUSTC_PATH_SECTION) else { println!( "info: dependencies could not be found in `{}` for {}, skipping file", project.cargo_file, project.name @@ -187,9 +182,7 @@ fn remove_rustc_src_from_project(project: &ClippyProjectInfo) -> bool { return true; }; - let end_point = if let Some(end_point) = cargo_content.find(DEPENDENCIES_SECTION) { - end_point - } else { + let Some(end_point) = cargo_content.find(DEPENDENCIES_SECTION) else { eprintln!( "error: the end of the rustc dependencies section could not be found in `{}`", project.cargo_file |
