clippy: clear the workspace errors and apply the machine fixes

- Mark the raw-pointer interop entry points unsafe with # Safety docs
  (oak-core upload/download/frame-from-pixels, oak-audio convert) and
  satisfy the existing callers (tests).
- mut_from_ref: allow with the ABI contract documented (the handle
  get_mut helpers in oak-timeline/oak-render/oak-task take the shared
  reference the C ABI passes; exclusivity is the caller's unsafe
  contract).
- Fix the eq_op in the white-balance normalization (green / green).
- Apply cargo clippy --fix across the workspace (redundant closures and
  field names, field reassignment, items after test modules, ...).
- Revert the replace_box fix in image_effect's clip_define: a
  redefinition must allocate a new box, otherwise the old clip handle
  stays valid and the HS-map replace contract (clip != clip2) breaks.
- 283 warnings remain; they are all non-machine-applicable
  (chunks_exact -> as_chunks needs a manual iter_mut, too_many_arguments,
  complex types, missing Safety docs, ...) and are tracked as the
  follow-up.
This commit is contained in:
2026-09-15 19:29:32 +08:00
parent 7e87ec135e
commit ee7ea18d94
146 changed files with 5235 additions and 4046 deletions
+4 -4
View File
@@ -760,12 +760,12 @@ impl TextGeneratorV3 {
text: row
.get(PLAIN_TEXT_INPUT)
.map(to_text)
.unwrap_or_else(String::new),
.unwrap_or_default(),
mode: TextLayoutMode::PlainText,
font_family: row
.get(FONT_FAMILY_INPUT)
.map(to_text)
.unwrap_or_else(String::new),
.unwrap_or_default(),
font_size_pt: row
.get(FONT_SIZE_INPUT)
.map(|v| v.to_double())
@@ -776,7 +776,7 @@ impl TextGeneratorV3 {
}
} else {
TextLayoutRequest {
text: row.get(TEXT_INPUT).map(to_text).unwrap_or_else(String::new),
text: row.get(TEXT_INPUT).map(to_text).unwrap_or_default(),
mode: TextLayoutMode::OliveHtml,
font_family: String::new(),
font_size_pt: 0.0,
@@ -2257,7 +2257,7 @@ mod tests {
else {
panic!("expected a CPU coverage frame");
};
let stride = frame.linesize_bytes() as usize;
let stride = frame.linesize_bytes();
let at = y * stride + x * 16;
let mut out = [0f32; 4];
for (c, v) in out.iter_mut().enumerate() {