Skip to content

Commit 845e212

Browse files
style: apply cargo fmt formatting
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent 58ef06a commit 845e212

3 files changed

Lines changed: 8 additions & 12 deletions

File tree

crates/aionui-team/src/scheduler/agent_lifecycle.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -62,9 +62,9 @@ impl TeammateManager {
6262
.ok_or_else(|| TeamError::AgentNotFound(slot_id.to_owned()))?;
6363

6464
// Check all other agents for name collision (exclude self).
65-
let conflict = slots.iter().any(|(id, s)| {
66-
id != slot_id && super::normalize_name(&s.agent.name) == normalized
67-
});
65+
let conflict = slots
66+
.iter()
67+
.any(|(id, s)| id != slot_id && super::normalize_name(&s.agent.name) == normalized);
6868
if conflict {
6969
return Err(TeamError::DuplicateAgentName(new_name.to_owned()));
7070
}

crates/aionui-team/src/service.rs

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -481,9 +481,10 @@ impl TeamSessionService {
481481
}
482482

483483
// Uniqueness check against all other agents in the team.
484-
let has_conflict = team.agents.iter().any(|a| {
485-
a.slot_id != slot_id && crate::scheduler::normalize_name(&a.name) == normalized
486-
});
484+
let has_conflict = team
485+
.agents
486+
.iter()
487+
.any(|a| a.slot_id != slot_id && crate::scheduler::normalize_name(&a.name) == normalized);
487488
if has_conflict {
488489
return Err(TeamError::DuplicateAgentName(name.to_owned()));
489490
}

crates/aionui-team/src/session.rs

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1371,12 +1371,7 @@ mod tests {
13711371
async fn rename_agent_rejects_duplicate_in_session() {
13721372
let session = start_session().await;
13731373
let agents = session.scheduler.list_agents().await;
1374-
let lead_name = agents
1375-
.iter()
1376-
.find(|a| a.slot_id == "lead-1")
1377-
.unwrap()
1378-
.name
1379-
.clone();
1374+
let lead_name = agents.iter().find(|a| a.slot_id == "lead-1").unwrap().name.clone();
13801375

13811376
// Rename worker-1 to the lead's name — should collide.
13821377
let result = session.rename_agent("worker-1", &lead_name).await;

0 commit comments

Comments
 (0)