Fix pre-existing clippy warnings in arc-workflows

- Replace useless format!() with .to_string() in parse_decision
- Derive Default for HookDecision instead of manual impl
- Use contains_key() instead of get().is_none() in semantic parser

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
Bryan Helmkamp 2026-03-05 10:11:44 -05:00
parent 3a7e7deb5a
commit 65e3a0bcee
3 changed files with 4 additions and 8 deletions

View file

@ -96,7 +96,7 @@ impl HookExecutorImpl {
return decision;
}
HookDecision::Block {
reason: Some(format!("hook exited with code 2")),
reason: Some("hook exited with code 2".to_string()),
}
} else {
HookDecision::Block {

View file

@ -108,9 +108,10 @@ pub struct PromptHookResponse {
}
/// Decision returned by blocking hooks.
#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)]
#[derive(Debug, Clone, Default, PartialEq, Eq, Serialize, Deserialize)]
#[serde(tag = "decision", rename_all = "snake_case")]
pub enum HookDecision {
#[default]
Proceed,
Skip {
#[serde(default)]
@ -125,11 +126,6 @@ pub enum HookDecision {
},
}
impl Default for HookDecision {
fn default() -> Self {
Self::Proceed
}
}
impl HookDecision {
/// Merge two decisions. Block > Skip/Override > Proceed.

View file

@ -109,7 +109,7 @@ impl SemanticState {
Self::add_class_to_node(node, cls);
}
// Legacy: translate codergen_mode to type if type is not explicitly set
if node.attrs.get("type").is_none() {
if !node.attrs.contains_key("type") {
if let Some(mode) = node.attrs.get("codergen_mode").and_then(AttrValue::as_str) {
let mapped = match mode {
"one_shot" => "prompt",