Skip to content

Commit

Permalink
fix(precommit): Fix up pre-commit
Browse files Browse the repository at this point in the history
Signed-off-by: dark0dave <[email protected]>
  • Loading branch information
dark0dave committed Dec 13, 2023
1 parent a78b658 commit ab3a65a
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ repos:
- id: remove-crlf

- repo: https://github.com/commitizen-tools/commitizen
rev: 3.12.0
rev: v3.13.0
hooks:
- id: commitizen
stages: [commit-msg]
Expand Down
12 changes: 6 additions & 6 deletions src/mod_component.rs
Original file line number Diff line number Diff line change
Expand Up @@ -18,34 +18,34 @@ impl From<String> for ModComponent {

let install_path = parts
.nth(1)
.expect(&format!("Could not get full name of mod, from: {}", line))
.unwrap_or_else(|| panic!("Could not get full name of mod, from: {}", line))
.to_string();

let tp_file = install_path
.split(MAIN_SEPARATOR)
.nth(1)
.expect(&format!("Could not find tp2 file, from: {}", line))
.unwrap_or_else(|| panic!("Could not find tp2 file, from: {}", line))
.to_string();

let name = install_path
.split(MAIN_SEPARATOR)
.next()
.expect(&format!("Could not split {} into mod into name and component", line))
.unwrap_or_else(|| panic!("Could not split {} into mod into name and component", line))
.to_ascii_lowercase();

let mut lang_and_component = parts
.next()
.expect(&format!("Could not find lang and component, from {}", line))
.unwrap_or_else(|| panic!("Could not find lang and component, from {}", line))
.split(' ');

let lang = lang_and_component
.nth(1)
.expect(&format!("Could not find lang, from: {}", line))
.unwrap_or_else(|| panic!("Could not find lang, from: {}", line))
.replace('#', "");

let component = lang_and_component
.next()
.expect(&format!("Could not find component, from {}", line))
.unwrap_or_else(|| panic!("Could not find component, from {}", line))
.replace('#', "");

ModComponent {
Expand Down

0 comments on commit ab3a65a

Please sign in to comment.