fix: Rewrite cli.rs with proper crate:: imports
Some checks failed
CI / lint (push) Failing after 3s
CI / build (push) Has been skipped
CI / test (push) Has been skipped

This commit is contained in:
2026-02-01 12:35:52 +00:00
parent 58ff331af3
commit 1e4086d33c

View File

@@ -15,7 +15,7 @@ pub enum CommitTypeCli {
Perf, Perf,
} }
#[derive(Debug, Parser)] #[derive(Parser, Debug)]
#[command(name = "auto-commit")] #[command(name = "auto-commit")]
#[command(author, version, about, long_about = None)] #[command(author, version, about, long_about = None)]
pub struct Args { pub struct Args {
@@ -35,25 +35,6 @@ pub struct Args {
pub verbose: bool, 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 { impl From<CommitTypeCli> for CommitType {
fn from(cli_type: CommitTypeCli) -> Self { fn from(cli_type: CommitTypeCli) -> Self {
match cli_type { match cli_type {