Skip to content

Commit b10bc7a

Browse files
chore: resolve clippy errors
1 parent 9b9753b commit b10bc7a

4 files changed

Lines changed: 7 additions & 16 deletions

File tree

.github/workflows/main.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,7 @@ jobs:
6565
run: cargo fmt -- --check
6666

6767
- name: Check clippy
68+
shell: bash
6869
run: |
6970
cargo clippy --all-targets --all-features -- \
7071
-D clippy::suspicious -D clippy::style -D clippy::complexity \

.github/workflows/pr.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,7 @@ jobs:
6969
run: cargo fmt -- --check
7070

7171
- name: Check clippy
72+
shell: bash
7273
run: |
7374
cargo clippy --all-targets --all-features -- \
7475
-D clippy::suspicious -D clippy::style -D clippy::complexity \

src/godot_manager.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -204,6 +204,7 @@ fn verify_sha512(
204204
/// - `Ok(Some(PathBuf))` containing the path to the Godot executable if found.
205205
/// - `Ok(None)` if no executable is found.
206206
/// - `Err(io::Error)` if there is an error reading the directory.
207+
#[allow(unused_variables)]
207208
fn find_godot_executable(version_dir: &Path, console: bool) -> Result<Option<PathBuf>> {
208209
// Collect all entries (files/folders) under version_dir
209210
let entries: Vec<_> = fs::read_dir(version_dir)?

src/project_version_detector.rs

Lines changed: 4 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -14,10 +14,7 @@ use crate::version_utils::GodotVersion;
1414
/// is specified in `config/features`.
1515
pub fn detect_godot_version_in_path<P: AsRef<Path>>(i18n: &I18n, path: P) -> Option<GodotVersion> {
1616
// Find the project root by walking up until we find `project.godot`.
17-
let project_file = match find_project_file(path.as_ref()) {
18-
Some(p) => p,
19-
None => return None,
20-
};
17+
let project_file = find_project_file(path.as_ref())?;
2118

2219
// Parse the file, looking for the `[application]` section and
2320
// `config/features=PackedStringArray(...)`.
@@ -47,26 +44,17 @@ pub fn detect_godot_version_in_path<P: AsRef<Path>>(i18n: &I18n, path: P) -> Opt
4744
}
4845

4946
// Extract lines for `[application]` section.
50-
let application_lines = match extract_application_section(&contents) {
51-
Some(lines) => lines,
52-
None => return None,
53-
};
47+
let application_lines = extract_application_section(&contents)?;
5448

5549
// Look for `config/features` line and parse out version.
5650
let features_line = application_lines
5751
.iter()
5852
.find(|line| line.trim_start().starts_with("config/features="));
5953

60-
let features_line = match features_line {
61-
Some(line) => line,
62-
None => return None,
63-
};
54+
let features_line = features_line?;
6455

6556
// Expects something like: config/features=PackedStringArray("4.3", "Forward Plus")
66-
let version_candidate = match parse_packed_string_array_for_version(features_line) {
67-
Some(v) => v,
68-
None => return None,
69-
};
57+
let version_candidate = parse_packed_string_array_for_version(features_line)?;
7058

7159
// Parse the version string x.x or x.x.x into GodotVersion.
7260
match parse_version_string(&version_candidate) {

0 commit comments

Comments
 (0)