Summary
`cargo clippy` reports 15 × `clippy::too_many_arguments` across the codebase.
These all originate from functions ported directly from C, where flat argument lists are idiomatic.
The Rust convention is to group related arguments into structs or builder types.
Affected functions
| File |
Line |
Args |
C origin |
| `crates/core/src/ar/labeling.rs` |
98 |
8/7 |
`arLabeling.c` |
| `crates/core/src/ar/marker.rs` |
229 |
9/7 |
`arDetectMarker.c` |
| `crates/core/src/ar/marker.rs` |
808 |
14/7 |
`arDetectMarker2.c` |
| `crates/core/src/ar/matrix.rs` |
85 |
11/7 |
`arGetMatrixCode.c` |
| `crates/core/src/ar/matrix.rs` |
389 |
8/7 |
`arGetMatrixCode.c` |
| `crates/core/src/ar/pattern.rs` |
202 |
10/7 |
`arPattGetID.c` |
| `crates/core/src/ar/pattern.rs` |
571 |
13/7 |
`arPattGetID.c` |
| `crates/core/src/ar/pattern.rs` |
795 |
12/7 |
`arPattGetID.c` |
| `crates/core/src/ar2/feature_map.rs` |
112 |
9/7 |
`ar2GenFeatureMap.c` |
| `crates/core/src/ar2/feature_map.rs` |
177 |
9/7 |
`ar2GenFeatureMap.c` |
| `crates/core/src/ar2/feature_map.rs` |
212 |
9/7 |
`ar2GenFeatureMap.c` |
| `crates/core/src/ar2/feature_map.rs` |
647 |
10/7 |
`ar2GenFeatureMap.c` |
| `crates/core/src/ar2/tracking.rs` |
1009 |
14/7 |
`ar2Tracking.c` |
| `crates/core/src/ar2/tracking.rs` |
1429 |
12/7 |
`ar2Tracking.c` |
| `crates/core/src/ar2/tracking.rs` |
1559 |
8/7 |
`ar2Tracking.c` |
Approach
For each affected function, group tightly coupled arguments into a dedicated params/context struct. Example:
```rust
// Before
fn ar_detect_marker2(
handle: &ARHandle,
label_info: &ARLabelInfo,
marker_num: usize,
// … 6 more args
) -> …
// After
struct DetectMarker2Params<'a> {
handle: &'a ARHandle,
label_info: &'a ARLabelInfo,
marker_num: usize,
// …
}
fn ar_detect_marker2(params: &DetectMarker2Params<'_>) -> …
```
Notes
- Changing public function signatures is a breaking API change — requires a semver bump.
- Internal (private/pub(crate)) functions can be refactored without a semver concern.
- Alternatively, add `#[allow(clippy::too_many_arguments)]` with a comment referencing this issue for functions that are part of a stable C-compatible public API.
Milestone: can be done incrementally per module after 0.4.0.
Summary
`cargo clippy` reports 15 × `clippy::too_many_arguments` across the codebase.
These all originate from functions ported directly from C, where flat argument lists are idiomatic.
The Rust convention is to group related arguments into structs or builder types.
Affected functions
Approach
For each affected function, group tightly coupled arguments into a dedicated params/context struct. Example:
```rust
// Before
fn ar_detect_marker2(
handle: &ARHandle,
label_info: &ARLabelInfo,
marker_num: usize,
// … 6 more args
) -> …
// After
struct DetectMarker2Params<'a> {
handle: &'a ARHandle,
label_info: &'a ARLabelInfo,
marker_num: usize,
// …
}
fn ar_detect_marker2(params: &DetectMarker2Params<'_>) -> …
```
Notes
Milestone: can be done incrementally per module after 0.4.0.