fix: Rewrite cli.rs with proper crate:: imports
This commit is contained in:
21
src/cli.rs
21
src/cli.rs
@@ -15,7 +15,7 @@ pub enum CommitTypeCli {
|
||||
Perf,
|
||||
}
|
||||
|
||||
#[derive(Debug, Parser)]
|
||||
#[derive(Parser, Debug)]
|
||||
#[command(name = "auto-commit")]
|
||||
#[command(author, version, about, long_about = None)]
|
||||
pub struct Args {
|
||||
@@ -35,25 +35,6 @@ pub struct Args {
|
||||
pub verbose: bool,
|
||||
}
|
||||
|
||||
impl std::str::FromStr for CommitTypeCli {
|
||||
type Err = String;
|
||||
|
||||
fn from_str(s: &str) -> Result<Self, Self::Err> {
|
||||
match s.to_lowercase().as_str() {
|
||||
"feat" | "feature" => Ok(CommitTypeCli::Feat),
|
||||
"fix" | "bug" => Ok(CommitTypeCli::Fix),
|
||||
"docs" | "documentation" => Ok(CommitTypeCli::Docs),
|
||||
"style" => Ok(CommitTypeCli::Style),
|
||||
"refactor" => Ok(CommitTypeCli::Refactor),
|
||||
"test" | "tests" => Ok(CommitTypeCli::Test),
|
||||
"chore" => Ok(CommitTypeCli::Chore),
|
||||
"build" | "ci" => Ok(CommitTypeCli::Build),
|
||||
"perf" | "performance" => Ok(CommitTypeCli::Perf),
|
||||
_ => Err(format!("Unknown commit type: {}", s)),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
impl From<CommitTypeCli> for CommitType {
|
||||
fn from(cli_type: CommitTypeCli) -> Self {
|
||||
match cli_type {
|
||||
|
||||
Reference in New Issue
Block a user