fix: perbaiki 5 warning clippy pre-existing (base untuk TUI overhaul)

unnested_or_patterns, collapsible_if, items_after_statements, dan
case_sensitive_file_extension_comparisons di auto.rs, engine.rs, dan
actions/mod.rs.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
This commit is contained in:
asepharyana
2026-07-14 23:41:53 +07:00
co-authored by Claude Sonnet 5
parent 7a9cb7bf34
commit 6b58977875
3 changed files with 12 additions and 8 deletions
+4 -4
View File
@@ -393,10 +393,10 @@ pub fn apply_action(state: &mut AppStateRest, action: Action) {
state.workflow_engine.agents.clear();
state.workflow_engine.findings.clear();
}
if message.to_lowercase().contains("complete") {
if state.misc.overlay == Overlay::Workflow {
state.misc.overlay = Overlay::None;
}
if message.to_lowercase().contains("complete")
&& state.misc.overlay == Overlay::Workflow
{
state.misc.overlay = Overlay::None;
}
state.push_toast(Toast {
kind: ToastKind::Info,
+7 -3
View File
@@ -109,17 +109,21 @@ fn is_production_code(path: &str) -> bool {
matches!(
c,
std::path::Component::Normal(seg)
if matches!(seg.to_str(), Some("test") | Some("tests") | Some("__tests__"))
if matches!(seg.to_str(), Some("test" | "tests" | "__tests__"))
)
});
let file_stem = path_obj.file_stem().and_then(|s| s.to_str()).unwrap_or("");
let is_test_filename = file_stem.starts_with("test_")
|| file_stem.ends_with("_test")
|| file_stem.ends_with(".test")
|| std::path::Path::new(file_stem)
.extension()
.is_some_and(|ext| ext.eq_ignore_ascii_case("test"))
|| file_stem == "spec"
|| file_stem.ends_with("_spec")
|| file_stem.ends_with(".spec");
|| std::path::Path::new(file_stem)
.extension()
.is_some_and(|ext| ext.eq_ignore_ascii_case("spec"));
if in_test_dir || is_test_filename {
return false;
+1 -1
View File
@@ -8,6 +8,7 @@
//! are not a weaker link than the main agent.
use std::fmt::Write;
use sha2::Digest;
use tokio::sync::mpsc;
use crate::dto::chat::message::ChatMessage;
use crate::dto::provider::request::ToolDef;
@@ -456,7 +457,6 @@ pub fn run_subagent(ctx: &SubagentContext, tx: &mpsc::Sender<SubagentEvent>) ->
.unwrap_or("unknown");
let content_sha256 = {
let content = args.get("content").or_else(|| args.get("new"));
use sha2::Digest;
let hash = sha2::Sha256::digest(
content.and_then(|v| v.as_str()).unwrap_or("").as_bytes(),
);