Skip to content

Commit 0f3f04d

Browse files
committed
Fix clippy and fmt issues
1 parent 46e6596 commit 0f3f04d

File tree

14 files changed

+19
-56
lines changed

14 files changed

+19
-56
lines changed

crates/chat-cli/src/cli/chat/cli/knowledge.rs

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -326,13 +326,9 @@ impl KnowledgeSubcommand {
326326

327327
// Try path first, then name
328328
if store.remove_by_path(&sanitized_path.to_string_lossy()).await.is_ok() {
329-
OperationResult::Success(format!(
330-
"Removed {scope_desc} knowledge base entry with path '{path}'"
331-
))
329+
OperationResult::Success(format!("Removed {scope_desc} knowledge base entry with path '{path}'"))
332330
} else if store.remove_by_name(path).await.is_ok() {
333-
OperationResult::Success(format!(
334-
"Removed {scope_desc} knowledge base entry with name '{path}'"
335-
))
331+
OperationResult::Success(format!("Removed {scope_desc} knowledge base entry with name '{path}'"))
336332
} else {
337333
OperationResult::Warning(format!("Entry not found in {scope_desc} knowledge base: {path}"))
338334
}

crates/chat-cli/src/cli/chat/cli/prompts.rs

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2500,10 +2500,7 @@ mod tests {
25002500
let prompt_name = "test_prompt";
25012501
let server_names = ["server1", "server2", "server3"];
25022502

2503-
let alt_names: Vec<String> = server_names
2504-
.iter()
2505-
.map(|s| format!("- @{s}/{prompt_name}"))
2506-
.collect();
2503+
let alt_names: Vec<String> = server_names.iter().map(|s| format!("- @{s}/{prompt_name}")).collect();
25072504
let alt_msg = format!("\n{}\n", alt_names.join("\n"));
25082505

25092506
assert_eq!(

crates/chat-cli/src/cli/chat/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1747,7 +1747,7 @@ impl ChatSession {
17471747
execute!(self.stderr, cursor::Hide, style::Print("\n"))?;
17481748
self.spinner = Some(Spinner::new(
17491749
Spinners::Dots,
1750-
format!("Generating agent config for '{}'...", agent_name),
1750+
format!("Generating agent config for '{agent_name}'..."),
17511751
));
17521752
}
17531753

crates/chat-cli/src/cli/chat/tools/delegate.rs

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -163,9 +163,7 @@ pub async fn launch_agent(os: &Os, agent: &str, agents: &Agents, task: &str) ->
163163
}
164164

165165
fn format_launch_success(agent: &str, task: &str) -> String {
166-
format!(
167-
"✓ Agent '{agent}' launched successfully.\nTask: {task}\n\nUse 'status' operation to check progress."
168-
)
166+
format!("✓ Agent '{agent}' launched successfully.\nTask: {task}\n\nUse 'status' operation to check progress.")
169167
}
170168

171169
pub fn display_agent_info(agent: &str, task: &str, config: &AgentConfig) -> Result<()> {

crates/chat-cli/src/cli/chat/tools/execute/mod.rs

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -695,9 +695,7 @@ mod tests {
695695
let user_agent_value = env_vars.get(USER_AGENT_ENV_VAR).unwrap();
696696

697697
// Check the format is correct
698-
let expected_metadata = format!(
699-
"{USER_AGENT_APP_NAME} {USER_AGENT_VERSION_KEY}/{USER_AGENT_VERSION_VALUE}"
700-
);
698+
let expected_metadata = format!("{USER_AGENT_APP_NAME} {USER_AGENT_VERSION_KEY}/{USER_AGENT_VERSION_VALUE}");
701699
assert!(user_agent_value.contains(&expected_metadata));
702700
}
703701

crates/chat-cli/src/cli/chat/tools/fs_read.rs

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -697,10 +697,7 @@ impl FsDirectory {
697697
style::Print(" "),
698698
)?;
699699
let depth = self.depth.unwrap_or_default();
700-
Ok(queue!(
701-
updates,
702-
style::Print(format!("with maximum depth of {depth}"))
703-
)?)
700+
Ok(queue!(updates, style::Print(format!("with maximum depth of {depth}")))?)
704701
}
705702

706703
pub async fn invoke(&self, os: &Os, updates: &mut impl Write) -> Result<InvokeOutput> {

crates/chat-cli/src/cli/chat/tools/fs_write.rs

Lines changed: 2 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -699,23 +699,13 @@ fn print_diff(
699699
style::Print(sign),
700700
style::Print(" ")
701701
)?;
702-
queue!(
703-
output,
704-
style::Print(format!(
705-
"{old_i_str:>old_line_num_width$}"
706-
))
707-
)?;
702+
queue!(output, style::Print(format!("{old_i_str:>old_line_num_width$}")))?;
708703
if sign == " " {
709704
queue!(output, style::Print(", "))?;
710705
} else {
711706
queue!(output, style::Print(" "))?;
712707
}
713-
queue!(
714-
output,
715-
style::Print(format!(
716-
"{new_i_str:>new_line_num_width$}"
717-
))
718-
)?;
708+
queue!(output, style::Print(format!("{new_i_str:>new_line_num_width$}")))?;
719709
// Print the line.
720710
queue!(
721711
output,

crates/chat-cli/src/cli/chat/tools/knowledge.rs

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -507,9 +507,7 @@ impl Knowledge {
507507
output
508508
},
509509
(Err(contexts_err), Err(status_err)) => {
510-
format!(
511-
"Failed to get contexts: {contexts_err}\nFailed to get status: {status_err}"
512-
)
510+
format!("Failed to get contexts: {contexts_err}\nFailed to get status: {status_err}")
513511
},
514512
}
515513
},

crates/chat-cli/src/cli/chat/tools/mod.rs

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -517,9 +517,8 @@ pub fn env_vars_with_user_agent(os: &Os) -> std::collections::HashMap<String, St
517517
let mut env_vars: std::collections::HashMap<String, String> = std::env::vars().collect();
518518

519519
// Set up additional metadata for the AWS CLI user agent
520-
let user_agent_metadata_value = format!(
521-
"{USER_AGENT_APP_NAME} {USER_AGENT_VERSION_KEY}/{USER_AGENT_VERSION_VALUE}"
522-
);
520+
let user_agent_metadata_value =
521+
format!("{USER_AGENT_APP_NAME} {USER_AGENT_VERSION_KEY}/{USER_AGENT_VERSION_VALUE}");
523522

524523
// Check if the user agent metadata env var already exists using Os
525524
let existing_value = os.env.get(USER_AGENT_ENV_VAR).ok();

crates/chat-cli/src/cli/mcp.rs

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -408,11 +408,7 @@ impl StatusArgs {
408408
"Env Vars: {}\n",
409409
cfg.env.map_or_else(
410410
|| "(none)".into(),
411-
|e| e
412-
.iter()
413-
.map(|(k, v)| format!("{k}={v}"))
414-
.collect::<Vec<_>>()
415-
.join(", ")
411+
|e| e.iter().map(|(k, v)| format!("{k}={v}")).collect::<Vec<_>>().join(", ")
416412
)
417413
)),
418414
)?;

0 commit comments

Comments
 (0)