Skip to content

Commit 1c366e4

Browse files
committed
clippy
1 parent f1f0816 commit 1c366e4

File tree

2 files changed

+8
-13
lines changed

2 files changed

+8
-13
lines changed

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -204,7 +204,7 @@ impl CaptureManager {
204204
Some('A') => stats.added += 1,
205205
Some('M') => stats.modified += 1,
206206
Some('D') => stats.deleted += 1,
207-
Some('R') | Some('C') => stats.modified += 1,
207+
Some('R' | 'C') => stats.modified += 1,
208208
_ => {},
209209
}
210210
}
@@ -242,7 +242,7 @@ impl CaptureManager {
242242
])?;
243243

244244
if stat_output.status.success() {
245-
result.push_str("\n");
245+
result.push('\n');
246246
result.push_str(&String::from_utf8_lossy(&stat_output.stdout));
247247
}
248248

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

Lines changed: 6 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -98,10 +98,10 @@ impl CaptureSubcommand {
9898
match self {
9999
Self::Init => self.handle_init(os, session).await,
100100
Self::Restore { ref tag, hard } => self.handle_restore(session, tag.clone(), hard).await,
101-
Self::List { limit } => self.handle_list(session, limit),
101+
Self::List { limit } => Self::handle_list(session, limit),
102102
Self::Clean => self.handle_clean(os, session).await,
103-
Self::Expand { ref tag } => self.handle_expand(session, tag.clone()),
104-
Self::Diff { ref tag1, ref tag2 } => self.handle_diff(session, tag1.clone(), tag2.clone()),
103+
Self::Expand { ref tag } => Self::handle_expand(session, tag.clone()),
104+
Self::Diff { ref tag1, ref tag2 } => Self::handle_diff(session, tag1.clone(), tag2.clone()),
105105
}
106106
}
107107

@@ -215,7 +215,7 @@ impl CaptureSubcommand {
215215
})
216216
}
217217

218-
fn handle_list(&self, session: &mut ChatSession, limit: Option<usize>) -> Result<ChatState, ChatError> {
218+
fn handle_list(session: &mut ChatSession, limit: Option<usize>) -> Result<ChatState, ChatError> {
219219
let Some(manager) = session.conversation.capture_manager.as_ref() else {
220220
execute!(
221221
session.stderr,
@@ -275,7 +275,7 @@ impl CaptureSubcommand {
275275
})
276276
}
277277

278-
fn handle_expand(&self, session: &mut ChatSession, tag: String) -> Result<ChatState, ChatError> {
278+
fn handle_expand(session: &mut ChatSession, tag: String) -> Result<ChatState, ChatError> {
279279
let Some(manager) = session.conversation.capture_manager.as_ref() else {
280280
execute!(
281281
session.stderr,
@@ -296,12 +296,7 @@ impl CaptureSubcommand {
296296
})
297297
}
298298

299-
fn handle_diff(
300-
&self,
301-
session: &mut ChatSession,
302-
tag1: String,
303-
tag2: Option<String>,
304-
) -> Result<ChatState, ChatError> {
299+
fn handle_diff(session: &mut ChatSession, tag1: String, tag2: Option<String>) -> Result<ChatState, ChatError> {
305300
let Some(manager) = session.conversation.capture_manager.as_ref() else {
306301
execute!(
307302
session.stderr,

0 commit comments

Comments
 (0)