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:
@@ -69,7 +69,12 @@ fn build_project(media: &str) -> (Arc<Mutex<Project>>, NodeId) {
|
||||
let (ccore, cbehavior) = oak_node::block::clip_create();
|
||||
let clip = p.graph.add_node(ccore, cbehavior);
|
||||
p.graph
|
||||
.connect(footage, clip, oak_node::block::clip_input::TEXTURE_INPUT, -1)
|
||||
.connect(
|
||||
footage,
|
||||
clip,
|
||||
oak_node::block::clip_input::TEXTURE_INPUT,
|
||||
-1,
|
||||
)
|
||||
.expect("connect footage to clip");
|
||||
p.graph
|
||||
.get_mut(clip)
|
||||
@@ -207,7 +212,7 @@ fn export_writes_a_real_playable_mp4() {
|
||||
let oak_core::texture::Texture::Cpu(frame) = &tex else {
|
||||
panic!("decode produced a GPU texture");
|
||||
};
|
||||
let off = 32 * frame.linesize_bytes() as usize + 32 * 16;
|
||||
let off = 32 * frame.linesize_bytes() + 32 * 16;
|
||||
let r = f32::from_le_bytes(frame.data[off..off + 4].try_into().unwrap());
|
||||
let g = f32::from_le_bytes(frame.data[off + 4..off + 8].try_into().unwrap());
|
||||
assert!(
|
||||
|
||||
Reference in New Issue
Block a user