chore: enable clippy::redundant_clone (#3489)

Created this PR by:

- adding `redundant_clone` to `[workspace.lints.clippy]` in
`cargo-rs/Cargol.toml`
- running `cargo clippy --tests --fix`
- running `just fmt`

Though I had to clean up one instance of the following that resulted:

```rust
let codex = codex;
```
This commit is contained in:
Michael Bolin
2025-09-11 11:59:37 -07:00
committed by GitHub
parent 66967500bb
commit bec51f6c05
34 changed files with 71 additions and 98 deletions

View File

@@ -214,12 +214,7 @@ impl Codex {
let conversation_id = session.conversation_id;
// This task will run until Op::Shutdown is received.
tokio::spawn(submission_loop(
session.clone(),
turn_context,
config,
rx_sub,
));
tokio::spawn(submission_loop(session, turn_context, config, rx_sub));
let codex = Codex {
next_id: AtomicU64::new(0),
tx_sub,
@@ -1074,7 +1069,7 @@ impl AgentTask {
id: self.sub_id,
msg: EventMsg::TurnAborted(TurnAbortedEvent { reason }),
};
let sess = self.sess.clone();
let sess = self.sess;
tokio::spawn(async move {
sess.send_event(event).await;
});
@@ -1772,7 +1767,7 @@ async fn try_run_turn(
}
})
.map(|call_id| ResponseItem::CustomToolCallOutput {
call_id: call_id.clone(),
call_id,
output: "aborted".to_string(),
})
.collect::<Vec<_>>()
@@ -1792,7 +1787,7 @@ async fn try_run_turn(
cwd: turn_context.cwd.clone(),
approval_policy: turn_context.approval_policy,
sandbox_policy: turn_context.sandbox_policy.clone(),
model: turn_context.client.get_model().clone(),
model: turn_context.client.get_model(),
effort: turn_context.client.get_reasoning_effort(),
summary: turn_context.client.get_reasoning_summary(),
});
@@ -3154,7 +3149,7 @@ mod tests {
exit_code: 0,
stdout: StreamOutput::new(String::new()),
stderr: StreamOutput::new(String::new()),
aggregated_output: StreamOutput::new(full.clone()),
aggregated_output: StreamOutput::new(full),
duration: StdDuration::from_secs(1),
};
@@ -3188,7 +3183,7 @@ mod tests {
fn model_truncation_respects_byte_budget() {
// Construct a large output (about 100kB) so byte budget dominates
let big_line = "x".repeat(100);
let full = std::iter::repeat_n(big_line.clone(), 1000)
let full = std::iter::repeat_n(big_line, 1000)
.collect::<Vec<_>>()
.join("\n");