Skip to content

Commit 2f74cde

Browse files
committed
Fixed clippy lints
1 parent 53ec0e2 commit 2f74cde

File tree

2 files changed

+8
-7
lines changed

2 files changed

+8
-7
lines changed

src/main.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ use clap::{App, Shell};
1414
use gitjournal::GitJournal;
1515
use gitjournal::errors::*;
1616

17-
fn error_and_exit(string: &str, error: Error) {
17+
fn error_and_exit(string: &str, error: &Error) {
1818
error!("{}: {}", string, error);
1919
exit(1);
2020
}
@@ -33,7 +33,7 @@ fn is_program_in_path(program: &str) -> bool {
3333

3434
fn main() {
3535
if let Err(error) = run() {
36-
error_and_exit("Main", error);
36+
error_and_exit("Main", &error);
3737
}
3838
}
3939

@@ -55,7 +55,7 @@ fn run() -> Result<()> {
5555
match journal.prepare(sub_matches.value_of("message").ok_or_else(|| "No CLI 'message' provided")?,
5656
sub_matches.value_of("type")) {
5757
Ok(()) => info!("Commit message prepared."),
58-
Err(error) => error_and_exit("Commit message preparation failed", error),
58+
Err(error) => error_and_exit("Commit message preparation failed", &error),
5959
}
6060
}
6161
}
@@ -82,7 +82,7 @@ fn run() -> Result<()> {
8282
if let Some(sub_matches) = matches.subcommand_matches("verify") {
8383
match journal.verify(sub_matches.value_of("message").ok_or_else(|| "No CLI 'message' provided")?) {
8484
Ok(()) => info!("Commit message valid."),
85-
Err(error) => error_and_exit("Commit message invalid", error),
85+
Err(error) => error_and_exit("Commit message invalid", &error),
8686
}
8787
}
8888
}
@@ -100,7 +100,7 @@ fn run() -> Result<()> {
100100
&max_tags,
101101
&matches.is_present("all"),
102102
&matches.is_present("skip_unreleased")) {
103-
error_and_exit("Log parsing error", error);
103+
error_and_exit("Log parsing error", &error);
104104
}
105105

106106
// Generate the template or print the log

src/parser.rs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -875,9 +875,10 @@ impl Parser {
875875
// Do nothing on comments and empty parts
876876
if RE_COMMENT.is_match(part) || part.is_empty() {
877877
continue;
878+
}
878879

879-
// Parse the footer
880-
} else if RE_FOOTER.is_match(part) {
880+
// Parse the footer
881+
if RE_FOOTER.is_match(part) {
881882
for cap in RE_FOOTER.captures_iter(part) {
882883
let key = cap.get(1)
883884
.map(|k| k.as_str())

0 commit comments

Comments
 (0)