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:
co-authored by
Claude Sonnet 5
parent
7a9cb7bf34
commit
6b58977875
@@ -393,10 +393,10 @@ pub fn apply_action(state: &mut AppStateRest, action: Action) {
|
|||||||
state.workflow_engine.agents.clear();
|
state.workflow_engine.agents.clear();
|
||||||
state.workflow_engine.findings.clear();
|
state.workflow_engine.findings.clear();
|
||||||
}
|
}
|
||||||
if message.to_lowercase().contains("complete") {
|
if message.to_lowercase().contains("complete")
|
||||||
if state.misc.overlay == Overlay::Workflow {
|
&& state.misc.overlay == Overlay::Workflow
|
||||||
state.misc.overlay = Overlay::None;
|
{
|
||||||
}
|
state.misc.overlay = Overlay::None;
|
||||||
}
|
}
|
||||||
state.push_toast(Toast {
|
state.push_toast(Toast {
|
||||||
kind: ToastKind::Info,
|
kind: ToastKind::Info,
|
||||||
|
|||||||
@@ -109,17 +109,21 @@ fn is_production_code(path: &str) -> bool {
|
|||||||
matches!(
|
matches!(
|
||||||
c,
|
c,
|
||||||
std::path::Component::Normal(seg)
|
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 file_stem = path_obj.file_stem().and_then(|s| s.to_str()).unwrap_or("");
|
||||||
let is_test_filename = file_stem.starts_with("test_")
|
let is_test_filename = file_stem.starts_with("test_")
|
||||||
|| file_stem.ends_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 == "spec"
|
||||||
|| file_stem.ends_with("_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 {
|
if in_test_dir || is_test_filename {
|
||||||
return false;
|
return false;
|
||||||
|
|||||||
@@ -8,6 +8,7 @@
|
|||||||
//! are not a weaker link than the main agent.
|
//! are not a weaker link than the main agent.
|
||||||
|
|
||||||
use std::fmt::Write;
|
use std::fmt::Write;
|
||||||
|
use sha2::Digest;
|
||||||
use tokio::sync::mpsc;
|
use tokio::sync::mpsc;
|
||||||
use crate::dto::chat::message::ChatMessage;
|
use crate::dto::chat::message::ChatMessage;
|
||||||
use crate::dto::provider::request::ToolDef;
|
use crate::dto::provider::request::ToolDef;
|
||||||
@@ -456,7 +457,6 @@ pub fn run_subagent(ctx: &SubagentContext, tx: &mpsc::Sender<SubagentEvent>) ->
|
|||||||
.unwrap_or("unknown");
|
.unwrap_or("unknown");
|
||||||
let content_sha256 = {
|
let content_sha256 = {
|
||||||
let content = args.get("content").or_else(|| args.get("new"));
|
let content = args.get("content").or_else(|| args.get("new"));
|
||||||
use sha2::Digest;
|
|
||||||
let hash = sha2::Sha256::digest(
|
let hash = sha2::Sha256::digest(
|
||||||
content.and_then(|v| v.as_str()).unwrap_or("").as_bytes(),
|
content.and_then(|v| v.as_str()).unwrap_or("").as_bytes(),
|
||||||
);
|
);
|
||||||
|
|||||||
Reference in New Issue
Block a user