diff --git a/src-tauri/src/ai/anthropic.rs b/src-tauri/src/ai/anthropic.rs index 0312aeaa..a7f69b5e 100644 --- a/src-tauri/src/ai/anthropic.rs +++ b/src-tauri/src/ai/anthropic.rs @@ -85,7 +85,7 @@ impl Provider for AnthropicProvider { if !resp.status().is_success() { let status = resp.status(); let text = resp.text().await?; - anyhow::bail!("Anthropic API error {}: {}", status, text); + anyhow::bail!("Anthropic API error {status}: {text}"); } let json: serde_json::Value = resp.json().await?; diff --git a/src-tauri/src/ai/gemini.rs b/src-tauri/src/ai/gemini.rs index d5af3822..12052a53 100644 --- a/src-tauri/src/ai/gemini.rs +++ b/src-tauri/src/ai/gemini.rs @@ -86,7 +86,7 @@ impl Provider for GeminiProvider { if !resp.status().is_success() { let status = resp.status(); let text = resp.text().await?; - anyhow::bail!("Gemini API error {}: {}", status, text); + anyhow::bail!("Gemini API error {status}: {text}"); } let json: serde_json::Value = resp.json().await?; diff --git a/src-tauri/src/ai/mistral.rs b/src-tauri/src/ai/mistral.rs index 4eab6233..4f62c915 100644 --- a/src-tauri/src/ai/mistral.rs +++ b/src-tauri/src/ai/mistral.rs @@ -37,7 +37,7 @@ impl Provider for MistralProvider { } else { config.api_url.trim_end_matches('/').to_string() }; - let url = format!("{}/chat/completions", base_url); + let url = format!("{base_url}/chat/completions"); let body = serde_json::json!({ "model": config.model, @@ -56,7 +56,7 @@ impl Provider for MistralProvider { if !resp.status().is_success() { let status = resp.status(); let text = resp.text().await?; - anyhow::bail!("Mistral API error {}: {}", status, text); + anyhow::bail!("Mistral API error {status}: {text}"); } let json: serde_json::Value = resp.json().await?; diff --git a/src-tauri/src/ai/ollama.rs b/src-tauri/src/ai/ollama.rs index ee0a1154..c2140fec 100644 --- a/src-tauri/src/ai/ollama.rs +++ b/src-tauri/src/ai/ollama.rs @@ -37,7 +37,7 @@ impl Provider for OllamaProvider { } else { config.api_url.trim_end_matches('/').to_string() }; - let url = format!("{}/api/chat", base_url); + let url = format!("{base_url}/api/chat"); // Ollama expects {model, messages: [{role, content}], stream: false} let api_messages: Vec = messages @@ -66,7 +66,7 @@ impl Provider for OllamaProvider { if !resp.status().is_success() { let status = resp.status(); let text = resp.text().await?; - anyhow::bail!("Ollama API error {}: {}", status, text); + anyhow::bail!("Ollama API error {status}: {text}"); } let json: serde_json::Value = resp.json().await?; diff --git a/src-tauri/src/ai/openai.rs b/src-tauri/src/ai/openai.rs index 57df3c56..c57635a4 100644 --- a/src-tauri/src/ai/openai.rs +++ b/src-tauri/src/ai/openai.rs @@ -49,7 +49,7 @@ impl Provider for OpenAiProvider { if !resp.status().is_success() { let status = resp.status(); let text = resp.text().await?; - anyhow::bail!("OpenAI API error {}: {}", status, text); + anyhow::bail!("OpenAI API error {status}: {text}"); } let json: serde_json::Value = resp.json().await?; diff --git a/src-tauri/src/commands/ai.rs b/src-tauri/src/commands/ai.rs index f1befd58..86c722f8 100644 --- a/src-tauri/src/commands/ai.rs +++ b/src-tauri/src/commands/ai.rs @@ -23,7 +23,7 @@ pub async fn analyze_logs( if let Ok((name, path)) = stmt.query_row([file_id], |row| { Ok((row.get::<_, String>(0)?, row.get::<_, String>(1)?)) }) { - log_contents.push_str(&format!("--- {} ---\n", name)); + log_contents.push_str(&format!("--- {name} ---\n")); if let Ok(content) = std::fs::read_to_string(&path) { log_contents.push_str(&content); } else { @@ -48,7 +48,7 @@ pub async fn analyze_logs( }, Message { role: "user".into(), - content: format!("Analyze logs for issue {}:\n\n{}", issue_id, log_contents), + content: format!("Analyze logs for issue {issue_id}:\n\n{log_contents}"), }, ]; diff --git a/src-tauri/src/commands/analysis.rs b/src-tauri/src/commands/analysis.rs index 8e205049..83a1f74f 100644 --- a/src-tauri/src/commands/analysis.rs +++ b/src-tauri/src/commands/analysis.rs @@ -187,7 +187,7 @@ pub async fn apply_redactions( let data_hash = pii::hash_content(&redacted_text); // Save redacted file alongside original - let redacted_path = format!("{}.redacted", file_path); + let redacted_path = format!("{file_path}.redacted"); std::fs::write(&redacted_path, &redacted_text).map_err(|e| e.to_string())?; // Mark the log file as redacted in DB diff --git a/src-tauri/src/commands/db.rs b/src-tauri/src/commands/db.rs index a9cb70be..7ab2bcde 100644 --- a/src-tauri/src/commands/db.rs +++ b/src-tauri/src/commands/db.rs @@ -307,7 +307,7 @@ pub async fn list_issues( params.push(Box::new(category.clone())); } if let Some(ref search) = filter.search { - let pattern = format!("%{}%", search); + let pattern = format!("%{search}%"); sql.push_str(&format!( " AND (i.title LIKE ?{0} OR i.description LIKE ?{0} OR i.category LIKE ?{0})", params.len() + 1 diff --git a/src-tauri/src/commands/docs.rs b/src-tauri/src/commands/docs.rs index 9aac0364..80086779 100644 --- a/src-tauri/src/commands/docs.rs +++ b/src-tauri/src/commands/docs.rs @@ -143,16 +143,16 @@ pub async fn export_document( let output_path = match format.as_str() { "markdown" | "md" => { - let path = format!("{}/{}.md", output_dir, safe_title); + let path = format!("{output_dir}/{safe_title}.md"); exporter::export_markdown(&content_md, &path).map_err(|e| e.to_string())?; path } "pdf" => { - let path = format!("{}/{}.pdf", output_dir, safe_title); + let path = format!("{output_dir}/{safe_title}.pdf"); exporter::export_pdf(&content_md, &title, &path).map_err(|e| e.to_string())?; path } - _ => return Err(format!("Unsupported export format: {}", format)), + _ => return Err(format!("Unsupported export format: {format}")), }; Ok(output_path) diff --git a/src-tauri/src/docs/postmortem.rs b/src-tauri/src/docs/postmortem.rs index fa997bda..1a5631ff 100644 --- a/src-tauri/src/docs/postmortem.rs +++ b/src-tauri/src/docs/postmortem.rs @@ -47,7 +47,7 @@ pub fn generate_postmortem_markdown(detail: &IssueDetail) -> String { md.push_str("|------------|-------|\n"); md.push_str(&format!("| {} | Issue created |\n", issue.created_at)); if let Some(ref resolved) = issue.resolved_at { - md.push_str(&format!("| {} | Issue resolved |\n", resolved)); + md.push_str(&format!("| {resolved} | Issue resolved |\n")); } md.push_str("| _HH:MM_ | _[Add additional timeline events]_ |\n\n"); diff --git a/src-tauri/src/docs/rca.rs b/src-tauri/src/docs/rca.rs index f437e65d..cff36be7 100644 --- a/src-tauri/src/docs/rca.rs +++ b/src-tauri/src/docs/rca.rs @@ -26,7 +26,7 @@ pub fn generate_rca_markdown(detail: &IssueDetail) -> String { md.push_str(&format!("| **Created** | {} |\n", issue.created_at)); md.push_str(&format!("| **Last Updated** | {} |\n", issue.updated_at)); if let Some(ref resolved) = issue.resolved_at { - md.push_str(&format!("| **Resolved** | {} |\n", resolved)); + md.push_str(&format!("| **Resolved** | {resolved} |\n")); } md.push('\n'); diff --git a/src-tauri/src/ollama/manager.rs b/src-tauri/src/ollama/manager.rs index e4b0d980..cea05941 100644 --- a/src-tauri/src/ollama/manager.rs +++ b/src-tauri/src/ollama/manager.rs @@ -5,7 +5,7 @@ const OLLAMA_BASE: &str = "http://localhost:11434"; pub async fn list_models() -> anyhow::Result> { let resp: serde_json::Value = reqwest::Client::new() - .get(format!("{}/api/tags", OLLAMA_BASE)) + .get(format!("{OLLAMA_BASE}/api/tags")) .send() .await? .json() @@ -32,7 +32,7 @@ pub async fn list_models() -> anyhow::Result> { pub async fn pull_model(app_handle: tauri::AppHandle, model_name: &str) -> anyhow::Result<()> { let client = reqwest::Client::new(); let mut resp = client - .post(format!("{}/api/pull", OLLAMA_BASE)) + .post(format!("{OLLAMA_BASE}/api/pull")) .json(&serde_json::json!({ "name": model_name, "stream": true })) .send() .await?; @@ -69,7 +69,7 @@ pub async fn pull_model(app_handle: tauri::AppHandle, model_name: &str) -> anyho pub async fn delete_model(model_name: &str) -> anyhow::Result<()> { let resp = reqwest::Client::new() - .delete(format!("{}/api/delete", OLLAMA_BASE)) + .delete(format!("{OLLAMA_BASE}/api/delete")) .json(&serde_json::json!({ "name": model_name })) .send() .await?; diff --git a/src-tauri/src/pii/mod.rs b/src-tauri/src/pii/mod.rs index 29ba6c65..b67b109f 100644 --- a/src-tauri/src/pii/mod.rs +++ b/src-tauri/src/pii/mod.rs @@ -56,7 +56,7 @@ pub struct PiiSpan { impl PiiSpan { pub fn new(pii_type: PiiType, start: usize, end: usize, original: String) -> Self { - let replacement = format!("[{}]", pii_type); + let replacement = format!("[{pii_type}]"); PiiSpan { id: Uuid::now_v7().to_string(), pii_type: pii_type.to_string(),