refactor: 移除未使用的代码和注释掉的辅助函数

This commit is contained in:
2026-03-20 18:05:33 +08:00
parent 0289dd4684
commit 0c7d2ad518
6 changed files with 123 additions and 118 deletions

View File

@@ -373,26 +373,26 @@ impl CommitCommand {
}
}
// Helper trait for optional builder methods
trait CommitBuilderExt {
fn scope_opt(self, scope: Option<String>) -> Self;
fn body_opt(self, body: Option<String>) -> Self;
}
// // Helper trait for optional builder methods
// trait CommitBuilderExt {
// fn scope_opt(self, scope: Option<String>) -> Self;
// fn body_opt(self, body: Option<String>) -> Self;
// }
impl CommitBuilderExt for CommitBuilder {
fn scope_opt(self, scope: Option<String>) -> Self {
if let Some(s) = scope {
self.scope(s)
} else {
self
}
}
// impl CommitBuilderExt for CommitBuilder {
// fn scope_opt(self, scope: Option<String>) -> Self {
// if let Some(s) = scope {
// self.scope(s)
// } else {
// self
// }
// }
fn body_opt(self, body: Option<String>) -> Self {
if let Some(b) = body {
self.body(b)
} else {
self
}
}
}
// fn body_opt(self, body: Option<String>) -> Self {
// if let Some(b) = body {
// self.body(b)
// } else {
// self
// }
// }
// }

View File

@@ -750,7 +750,7 @@ impl ConfigCommand {
let manager = self.get_manager(config_path)?;
let toml = manager.export()?;
let export_content = if let Some(path) = output {
let export_content = if let Some(_path) = output {
let pwd = if let Some(p) = password {
p.to_string()
} else {

View File

@@ -240,7 +240,7 @@ impl InitCommand {
.or_else(|_| std::env::var(format!("QUICOMMIT_{}_API_KEY", provider.to_uppercase())))
.ok();
if let Some(key) = env_key {
if let Some(_key) = env_key {
println!("\n{} {}", "".green(), "Found API key in environment variable.".green());
None
} else if keyring_available {