Skip to content

Commit 596d519

Browse files
mikolalysenkoclaude
andcommitted
refactor(ecosystem_dispatch): hoist MergeFn type alias for clippy
`-D clippy::type_complexity` rejected the inline fn-pointer signature on `dispatch_find`'s `pypi_merge` argument. Lift it to a `MergeFn` type alias shared by `merge_first_wins` and `merge_pypi_qualified`. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
1 parent 95f8cc4 commit 596d519

1 file changed

Lines changed: 7 additions & 5 deletions

File tree

crates/socket-patch-cli/src/ecosystem_dispatch.rs

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -155,6 +155,12 @@ macro_rules! scan_ecosystem {
155155
}};
156156
}
157157

158+
/// Signature shared by `merge_first_wins` and `merge_pypi_qualified`.
159+
/// `dispatch_find` swaps between them so the rollback path can fan one
160+
/// crawler result back out to every caller-supplied qualified PURL.
161+
type MergeFn =
162+
fn(&mut HashMap<String, PathBuf>, &[String], HashMap<String, CrawledPackage>);
163+
158164
/// Default merge: insert the crawler-returned PURL → first wins.
159165
fn merge_first_wins(
160166
out: &mut HashMap<String, PathBuf>,
@@ -208,11 +214,7 @@ async fn dispatch_find(
208214
partitioned: &HashMap<Ecosystem, Vec<String>>,
209215
options: &CrawlerOptions,
210216
silent: bool,
211-
pypi_merge: fn(
212-
&mut HashMap<String, PathBuf>,
213-
&[String],
214-
HashMap<String, CrawledPackage>,
215-
),
217+
pypi_merge: MergeFn,
216218
) -> HashMap<String, PathBuf> {
217219
let mut out: HashMap<String, PathBuf> = HashMap::new();
218220

0 commit comments

Comments
 (0)