Skip to content

Commit bdfdd0f

Browse files
committed
feat(lint): run cargo clippy --fix --lib -p auto-commit-rs
1 parent b19a167 commit bdfdd0f

4 files changed

Lines changed: 7 additions & 11 deletions

File tree

src/cache.rs

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -220,12 +220,9 @@ pub fn interactive_history() -> Result<()> {
220220
}
221221

222222
let options: Vec<String> = index.repos.iter().map(|e| e.repo_path.clone()).collect();
223-
match Select::new("Select repository:", options).prompt() {
224-
Ok(repo_path) => {
225-
let cache = load_repo_cache(&repo_path)?;
226-
show_repo_commits(&cache)?;
227-
}
228-
Err(_) => {}
223+
if let Ok(repo_path) = Select::new("Select repository:", options).prompt() {
224+
let cache = load_repo_cache(&repo_path)?;
225+
show_repo_commits(&cache)?;
229226
}
230227
}
231228
}

src/cli.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -338,10 +338,9 @@ pub fn interactive_config(global: bool) -> Result<()> {
338338
show_descriptions = !show_descriptions;
339339
}
340340
MenuAction::Search => {
341-
if let Some(query) = Text::new("Search:")
341+
if let Ok(query) = Text::new("Search:")
342342
.with_help_message("Enter text to search for in setting names")
343343
.prompt()
344-
.ok()
345344
{
346345
let query_lower = query.to_lowercase();
347346
if !query_lower.is_empty() {

src/preset.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -277,7 +277,7 @@ pub fn interactive_presets() -> Result<()> {
277277
}
278278
"Manage existing preset..." => {
279279
let options: Vec<String> =
280-
file.presets.iter().map(|p| preset_display(p)).collect();
280+
file.presets.iter().map(preset_display).collect();
281281
let Ok(choice) = Select::new("Select preset:", options.clone()).prompt() else {
282282
continue;
283283
};
@@ -516,7 +516,7 @@ pub fn select_and_load_preset(cfg: &mut AppConfig) -> Result<Option<(u32, LlmPre
516516
println!(" {}", "No presets found.".dimmed());
517517
return Ok(None);
518518
}
519-
let options: Vec<String> = file.presets.iter().map(|p| preset_display(p)).collect();
519+
let options: Vec<String> = file.presets.iter().map(preset_display).collect();
520520
match Select::new("Select preset to load:", options.clone()).prompt() {
521521
Ok(choice) => {
522522
let idx = options.iter().position(|o| o == &choice).unwrap();

src/provider.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -192,7 +192,7 @@ pub fn call_llm_with_fallback(
192192
diff: &str,
193193
) -> Result<(String, Option<String>)> {
194194
match call_llm_inner(cfg, system_prompt, diff) {
195-
Ok(msg) => return Ok((msg, None)),
195+
Ok(msg) => Ok((msg, None)),
196196
Err(LlmCallError::TransportError(msg)) => {
197197
anyhow::bail!("Network error: {msg}");
198198
}

0 commit comments

Comments
 (0)