fix: inline format args for Rust 1.88 clippy compatibility

This commit is contained in:
Shaun Arman 2026-03-15 13:28:59 -05:00
parent 5198b6c636
commit 808500b7bd
13 changed files with 20 additions and 20 deletions

View File

@ -85,7 +85,7 @@ impl Provider for AnthropicProvider {
if !resp.status().is_success() { if !resp.status().is_success() {
let status = resp.status(); let status = resp.status();
let text = resp.text().await?; 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?; let json: serde_json::Value = resp.json().await?;

View File

@ -86,7 +86,7 @@ impl Provider for GeminiProvider {
if !resp.status().is_success() { if !resp.status().is_success() {
let status = resp.status(); let status = resp.status();
let text = resp.text().await?; 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?; let json: serde_json::Value = resp.json().await?;

View File

@ -37,7 +37,7 @@ impl Provider for MistralProvider {
} else { } else {
config.api_url.trim_end_matches('/').to_string() 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!({ let body = serde_json::json!({
"model": config.model, "model": config.model,
@ -56,7 +56,7 @@ impl Provider for MistralProvider {
if !resp.status().is_success() { if !resp.status().is_success() {
let status = resp.status(); let status = resp.status();
let text = resp.text().await?; 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?; let json: serde_json::Value = resp.json().await?;

View File

@ -37,7 +37,7 @@ impl Provider for OllamaProvider {
} else { } else {
config.api_url.trim_end_matches('/').to_string() 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} // Ollama expects {model, messages: [{role, content}], stream: false}
let api_messages: Vec<serde_json::Value> = messages let api_messages: Vec<serde_json::Value> = messages
@ -66,7 +66,7 @@ impl Provider for OllamaProvider {
if !resp.status().is_success() { if !resp.status().is_success() {
let status = resp.status(); let status = resp.status();
let text = resp.text().await?; 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?; let json: serde_json::Value = resp.json().await?;

View File

@ -49,7 +49,7 @@ impl Provider for OpenAiProvider {
if !resp.status().is_success() { if !resp.status().is_success() {
let status = resp.status(); let status = resp.status();
let text = resp.text().await?; 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?; let json: serde_json::Value = resp.json().await?;

View File

@ -23,7 +23,7 @@ pub async fn analyze_logs(
if let Ok((name, path)) = stmt.query_row([file_id], |row| { if let Ok((name, path)) = stmt.query_row([file_id], |row| {
Ok((row.get::<_, String>(0)?, row.get::<_, String>(1)?)) 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) { if let Ok(content) = std::fs::read_to_string(&path) {
log_contents.push_str(&content); log_contents.push_str(&content);
} else { } else {
@ -48,7 +48,7 @@ pub async fn analyze_logs(
}, },
Message { Message {
role: "user".into(), 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}"),
}, },
]; ];

View File

@ -187,7 +187,7 @@ pub async fn apply_redactions(
let data_hash = pii::hash_content(&redacted_text); let data_hash = pii::hash_content(&redacted_text);
// Save redacted file alongside original // 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())?; std::fs::write(&redacted_path, &redacted_text).map_err(|e| e.to_string())?;
// Mark the log file as redacted in DB // Mark the log file as redacted in DB

View File

@ -307,7 +307,7 @@ pub async fn list_issues(
params.push(Box::new(category.clone())); params.push(Box::new(category.clone()));
} }
if let Some(ref search) = filter.search { if let Some(ref search) = filter.search {
let pattern = format!("%{}%", search); let pattern = format!("%{search}%");
sql.push_str(&format!( sql.push_str(&format!(
" AND (i.title LIKE ?{0} OR i.description LIKE ?{0} OR i.category LIKE ?{0})", " AND (i.title LIKE ?{0} OR i.description LIKE ?{0} OR i.category LIKE ?{0})",
params.len() + 1 params.len() + 1

View File

@ -143,16 +143,16 @@ pub async fn export_document(
let output_path = match format.as_str() { let output_path = match format.as_str() {
"markdown" | "md" => { "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())?; exporter::export_markdown(&content_md, &path).map_err(|e| e.to_string())?;
path path
} }
"pdf" => { "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())?; exporter::export_pdf(&content_md, &title, &path).map_err(|e| e.to_string())?;
path path
} }
_ => return Err(format!("Unsupported export format: {}", format)), _ => return Err(format!("Unsupported export format: {format}")),
}; };
Ok(output_path) Ok(output_path)

View File

@ -47,7 +47,7 @@ pub fn generate_postmortem_markdown(detail: &IssueDetail) -> String {
md.push_str("|------------|-------|\n"); md.push_str("|------------|-------|\n");
md.push_str(&format!("| {} | Issue created |\n", issue.created_at)); md.push_str(&format!("| {} | Issue created |\n", issue.created_at));
if let Some(ref resolved) = issue.resolved_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"); md.push_str("| _HH:MM_ | _[Add additional timeline events]_ |\n\n");

View File

@ -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!("| **Created** | {} |\n", issue.created_at));
md.push_str(&format!("| **Last Updated** | {} |\n", issue.updated_at)); md.push_str(&format!("| **Last Updated** | {} |\n", issue.updated_at));
if let Some(ref resolved) = issue.resolved_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'); md.push('\n');

View File

@ -5,7 +5,7 @@ const OLLAMA_BASE: &str = "http://localhost:11434";
pub async fn list_models() -> anyhow::Result<Vec<OllamaModel>> { pub async fn list_models() -> anyhow::Result<Vec<OllamaModel>> {
let resp: serde_json::Value = reqwest::Client::new() let resp: serde_json::Value = reqwest::Client::new()
.get(format!("{}/api/tags", OLLAMA_BASE)) .get(format!("{OLLAMA_BASE}/api/tags"))
.send() .send()
.await? .await?
.json() .json()
@ -32,7 +32,7 @@ pub async fn list_models() -> anyhow::Result<Vec<OllamaModel>> {
pub async fn pull_model(app_handle: tauri::AppHandle, model_name: &str) -> anyhow::Result<()> { pub async fn pull_model(app_handle: tauri::AppHandle, model_name: &str) -> anyhow::Result<()> {
let client = reqwest::Client::new(); let client = reqwest::Client::new();
let mut resp = client 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 })) .json(&serde_json::json!({ "name": model_name, "stream": true }))
.send() .send()
.await?; .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<()> { pub async fn delete_model(model_name: &str) -> anyhow::Result<()> {
let resp = reqwest::Client::new() let resp = reqwest::Client::new()
.delete(format!("{}/api/delete", OLLAMA_BASE)) .delete(format!("{OLLAMA_BASE}/api/delete"))
.json(&serde_json::json!({ "name": model_name })) .json(&serde_json::json!({ "name": model_name }))
.send() .send()
.await?; .await?;

View File

@ -56,7 +56,7 @@ pub struct PiiSpan {
impl PiiSpan { impl PiiSpan {
pub fn new(pii_type: PiiType, start: usize, end: usize, original: String) -> Self { pub fn new(pii_type: PiiType, start: usize, end: usize, original: String) -> Self {
let replacement = format!("[{}]", pii_type); let replacement = format!("[{pii_type}]");
PiiSpan { PiiSpan {
id: Uuid::now_v7().to_string(), id: Uuid::now_v7().to_string(),
pii_type: pii_type.to_string(), pii_type: pii_type.to_string(),