Skip to content

Commit

Permalink
chore: run clippy
Browse files Browse the repository at this point in the history
  • Loading branch information
elcoosp committed Dec 3, 2024
1 parent 114ea2c commit 085543a
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 11 deletions.
11 changes: 3 additions & 8 deletions cli/src/args.rs
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ impl Args {
if let Some(edit) = self.edit.as_deref() {
if edit != "false" {
let msg = std::fs::read_to_string(edit)
.expect(format!("Failed to read commit message from {}", edit).as_str());
.unwrap_or_else(|_| panic!("Failed to read commit message from {}", edit));
return Ok(vec![Message::new(msg)]);
}
}
Expand Down Expand Up @@ -87,13 +87,8 @@ impl Args {
}

let default_path = std::path::PathBuf::from(".git").join("COMMIT_EDITMSG");
let msg = std::fs::read_to_string(&default_path).expect(
format!(
"Failed to read commit message from {}",
default_path.display()
)
.as_str(),
);
let msg = std::fs::read_to_string(&default_path).unwrap_or_else(|_| panic!("Failed to read commit message from {}",
default_path.display()));
Ok(vec![Message::new(msg)])
}
}
6 changes: 3 additions & 3 deletions cli/src/rule.rs
Original file line number Diff line number Diff line change
Expand Up @@ -245,7 +245,7 @@ macro_rules! make_length_rule {
$ident:ident,
$length_of_what:literal
) => {
crate::make_rule! {
$crate::make_rule! {
$ident,
#[doc = concat!("Length represents the maximum length of the ",stringify!($length_of_what),".")]
length: usize
Expand All @@ -259,7 +259,7 @@ macro_rules! make_format_rule {
$ident:ident,
$format_of_what:literal
) => {
crate::make_rule! {
$crate::make_rule! {
$ident,
#[doc = concat!("Format represents the format of the ",stringify!($format_of_what),".")]
format: Option<String>
Expand All @@ -278,7 +278,7 @@ macro_rules! make_options_rule {
)*
$field_name:ident: $field_type:ty
),*) => {
crate::make_rule! {
$crate::make_rule! {
$ident,
$(
$(
Expand Down

0 comments on commit 085543a

Please sign in to comment.