Skip to content

Commit 7c39ed6

Browse files
Brooooooklynclaude
andauthored
style: fix clippy::redundant_closure_for_method_calls warnings (#230)
Replace redundant closures with direct method references: - with_argv.rs: Replace |p| p.is_null() with <*const i8>::is_null - which.rs: Replace |s| s.to_owned() with BStr::to_owned 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
1 parent 4e12ee1 commit 7c39ed6

2 files changed

Lines changed: 2 additions & 2 deletions

File tree

crates/fspy_preload_unix/src/interceptions/spawn/exec/with_argv.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ pub unsafe fn with_argv(
1616
let argc = 1 + unsafe {
1717
va.with_copy(|mut copy| {
1818
core::iter::from_fn(|| Some(copy.arg::<*const c_char>()))
19-
.position(|p| p.is_null())
19+
.position(<*const i8>::is_null)
2020
.unwrap()
2121
})
2222
};

crates/fspy_shared_unix/src/exec/which.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ mod tests {
8686

8787
#[test]
8888
fn test_concat() {
89-
let s = concat(&["a".into(), "bc".into(), "".into(), "e".into()], |s| s.to_owned());
89+
let s = concat(&["a".into(), "bc".into(), "".into(), "e".into()], BStr::to_owned);
9090
assert_eq!(s, "abce");
9191
}
9292

0 commit comments

Comments
 (0)