cli: simplify `Message` default

Use the derive and `#[default]` mechanism for deriving the default of
`Message`.

Signed-off-by: Fintan Halpenny <fintan.halpenny@gmail.com>
X-Clacks-Overhead: GNU Terry Pratchett
This commit is contained in:
Fintan Halpenny 2023-12-01 12:05:32 +00:00 committed by cloudhead
parent 3681c0e6df
commit 6a3a66ae9c
No known key found for this signature in database
1 changed files with 2 additions and 7 deletions

View File

@ -25,9 +25,10 @@ pub enum Error {
}
/// The user supplied `Patch` description.
#[derive(Clone, Debug, PartialEq, Eq)]
#[derive(Clone, Debug, Default, PartialEq, Eq)]
pub enum Message {
/// Prompt user to write comment in editor.
#[default]
Edit,
/// Don't leave a comment.
Blank,
@ -97,12 +98,6 @@ impl Message {
}
}
impl Default for Message {
fn default() -> Self {
Self::Edit
}
}
pub const PATCH_MSG: &str = r#"
<!--
Please enter a patch message for your changes. An empty