diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index bb5b02e..0f26f6a 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -65,6 +65,7 @@ jobs: run: cargo fmt -- --check - name: Check clippy + shell: bash run: | cargo clippy --all-targets --all-features -- \ -D clippy::suspicious -D clippy::style -D clippy::complexity \ diff --git a/.github/workflows/pr.yml b/.github/workflows/pr.yml index 7ee3cad..ddb1b87 100644 --- a/.github/workflows/pr.yml +++ b/.github/workflows/pr.yml @@ -69,6 +69,7 @@ jobs: run: cargo fmt -- --check - name: Check clippy + shell: bash run: | cargo clippy --all-targets --all-features -- \ -D clippy::suspicious -D clippy::style -D clippy::complexity \ diff --git a/src/godot_manager.rs b/src/godot_manager.rs index afed1f8..b49f5c5 100644 --- a/src/godot_manager.rs +++ b/src/godot_manager.rs @@ -204,6 +204,7 @@ fn verify_sha512( /// - `Ok(Some(PathBuf))` containing the path to the Godot executable if found. /// - `Ok(None)` if no executable is found. /// - `Err(io::Error)` if there is an error reading the directory. +#[allow(unused_variables)] fn find_godot_executable(version_dir: &Path, console: bool) -> Result> { // Collect all entries (files/folders) under version_dir let entries: Vec<_> = fs::read_dir(version_dir)? diff --git a/src/project_version_detector.rs b/src/project_version_detector.rs index 177aa11..1daf033 100644 --- a/src/project_version_detector.rs +++ b/src/project_version_detector.rs @@ -14,10 +14,7 @@ use crate::version_utils::GodotVersion; /// is specified in `config/features`. pub fn detect_godot_version_in_path>(i18n: &I18n, path: P) -> Option { // Find the project root by walking up until we find `project.godot`. - let project_file = match find_project_file(path.as_ref()) { - Some(p) => p, - None => return None, - }; + let project_file = find_project_file(path.as_ref())?; // Parse the file, looking for the `[application]` section and // `config/features=PackedStringArray(...)`. @@ -47,26 +44,17 @@ pub fn detect_godot_version_in_path>(i18n: &I18n, path: P) -> Opt } // Extract lines for `[application]` section. - let application_lines = match extract_application_section(&contents) { - Some(lines) => lines, - None => return None, - }; + let application_lines = extract_application_section(&contents)?; // Look for `config/features` line and parse out version. let features_line = application_lines .iter() .find(|line| line.trim_start().starts_with("config/features=")); - let features_line = match features_line { - Some(line) => line, - None => return None, - }; + let features_line = features_line?; // Expects something like: config/features=PackedStringArray("4.3", "Forward Plus") - let version_candidate = match parse_packed_string_array_for_version(features_line) { - Some(v) => v, - None => return None, - }; + let version_candidate = parse_packed_string_array_for_version(features_line)?; // Parse the version string x.x or x.x.x into GodotVersion. match parse_version_string(&version_candidate) {