chore: clippy on redundant closure (#4058)

Add redundant closure clippy rules and let Codex fix it by minimising
FQP
This commit is contained in:
jif-oai
2025-09-22 20:30:16 +01:00
committed by GitHub
parent c75920a071
commit be366a31ab
43 changed files with 97 additions and 86 deletions

View File

@@ -421,7 +421,7 @@ impl ChatComposer {
// Capture any needed data from popup before clearing it.
let prompt_content = match sel {
CommandItem::UserPrompt(idx) => {
popup.prompt_content(idx).map(|s| s.to_string())
popup.prompt_content(idx).map(str::to_string)
}
_ => None,
};
@@ -550,7 +550,7 @@ impl ChatComposer {
let format_label = match Path::new(&sel_path)
.extension()
.and_then(|e| e.to_str())
.map(|s| s.to_ascii_lowercase())
.map(str::to_ascii_lowercase)
{
Some(ext) if ext == "png" => "PNG",
Some(ext) if ext == "jpg" || ext == "jpeg" => "JPEG",
@@ -617,7 +617,7 @@ impl ChatComposer {
text[safe_cursor..]
.chars()
.next()
.map(|c| c.is_whitespace())
.map(char::is_whitespace)
.unwrap_or(false)
} else {
false
@@ -645,7 +645,7 @@ impl ChatComposer {
let ws_len_right: usize = after_cursor
.chars()
.take_while(|c| c.is_whitespace())
.map(|c| c.len_utf8())
.map(char::len_utf8)
.sum();
let start_right = safe_cursor + ws_len_right;
let end_right_rel = text[start_right..]