Skip to content

Commit 0186471

Browse files
committed
chore(deps): Bump deps and pre-commit
Signed-off-by: dark0dave <[email protected]>
1 parent 94ac998 commit 0186471

File tree

3 files changed

+60
-46
lines changed

3 files changed

+60
-46
lines changed

.pre-commit-config.yaml

+23-11
Original file line numberDiff line numberDiff line change
@@ -43,21 +43,11 @@ repos:
4343
stages: [pre-commit]
4444

4545
- repo: https://github.com/commitizen-tools/commitizen
46-
rev: v3.30.0
46+
rev: v4.1.0
4747
hooks:
4848
- id: commitizen
4949
stages: [commit-msg]
5050

51-
- repo: https://github.com/doublify/pre-commit-rust
52-
rev: v1.0
53-
hooks:
54-
- id: fmt
55-
stages: [pre-commit]
56-
- id: cargo-check
57-
stages: [pre-commit]
58-
- id: clippy
59-
stages: [pre-commit]
60-
6151
- repo: local
6252
hooks:
6353
- id: cargo-test
@@ -76,6 +66,28 @@ repos:
7666
language: script
7767
types: [rust]
7868
pass_filenames: false
69+
- id: fmt
70+
name: fmt
71+
description: Format files with cargo fmt.
72+
entry: cargo fmt
73+
language: system
74+
types: [rust]
75+
args: ["--"]
76+
- id: cargo-check
77+
name: cargo check
78+
description: Check the package for errors.
79+
entry: cargo check
80+
language: system
81+
types: [rust]
82+
pass_filenames: false
83+
- id: clippy
84+
name: clippy
85+
description: Lint rust sources
86+
entry: cargo clippy
87+
language: system
88+
args: ["--", "-D", "warnings"]
89+
types: [rust]
90+
pass_filenames: false
7991

8092
- repo: https://github.com/codespell-project/codespell
8193
rev: v2.3.0

Cargo.lock

+26-26
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/utils.rs

+11-9
Original file line numberDiff line numberDiff line change
@@ -48,17 +48,19 @@ fn find_mod_folder(mod_component: &Component, mod_dir: &Path, depth: usize) -> O
4848
.find_map(|entry| match entry {
4949
Ok(entry)
5050
if entry
51-
.path()
52-
.parent()
53-
.unwrap()
5451
.file_name()
55-
.unwrap_or_default()
56-
.eq_ignore_ascii_case(&mod_component.name)
57-
&& entry
58-
.file_name()
59-
.eq_ignore_ascii_case(&mod_component.tp_file) =>
52+
.eq_ignore_ascii_case(&mod_component.tp_file) =>
6053
{
61-
return Some(entry.into_path().parent().unwrap().into());
54+
if let Some(parent) = entry.path().parent() {
55+
if parent
56+
.file_name()
57+
.unwrap_or_default()
58+
.eq_ignore_ascii_case(&mod_component.name)
59+
{
60+
return Some(parent.to_path_buf());
61+
}
62+
}
63+
None
6264
}
6365
_ => None,
6466
})

0 commit comments

Comments
 (0)