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:
@@ -144,7 +144,7 @@ fn uuid_text_to_bytes(uuid: &str) -> [u8; 16] {
|
||||
break;
|
||||
}
|
||||
let d = c.to_digit(16).unwrap_or(0) as u8;
|
||||
if nibble % 2 == 0 {
|
||||
if nibble.is_multiple_of(2) {
|
||||
bytes[nibble / 2] = d << 4;
|
||||
} else {
|
||||
bytes[nibble / 2] |= d;
|
||||
@@ -286,7 +286,7 @@ impl PlaybackCache {
|
||||
pub fn set_uuid(&mut self, uuid: &str) {
|
||||
self.uuid = uuid.to_string();
|
||||
let dir = self.disk_dir.clone();
|
||||
let _ = self.load_state(&std::path::Path::new(&dir));
|
||||
let _ = self.load_state(std::path::Path::new(&dir));
|
||||
}
|
||||
|
||||
/// Set the frame timebase (frame-hash flavors; C++ `set_timebase`).
|
||||
@@ -319,7 +319,7 @@ impl PlaybackCache {
|
||||
self.passthroughs.retain(|(r, _)| !overlaps(*r, range));
|
||||
if self.saving_enabled {
|
||||
let dir = self.disk_dir.clone();
|
||||
let _ = self.save_state(&std::path::Path::new(&dir));
|
||||
let _ = self.save_state(std::path::Path::new(&dir));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -328,7 +328,7 @@ impl PlaybackCache {
|
||||
self.validated.insert(range);
|
||||
if self.saving_enabled {
|
||||
let dir = self.disk_dir.clone();
|
||||
let _ = self.save_state(&std::path::Path::new(&dir));
|
||||
let _ = self.save_state(std::path::Path::new(&dir));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -401,7 +401,7 @@ impl PlaybackCache {
|
||||
}
|
||||
if self.saving_enabled {
|
||||
let dir = self.disk_dir.clone();
|
||||
let _ = self.save_state(&std::path::Path::new(&dir));
|
||||
let _ = self.save_state(std::path::Path::new(&dir));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -421,7 +421,7 @@ impl PlaybackCache {
|
||||
}
|
||||
if self.saving_enabled {
|
||||
let dir = self.disk_dir.clone();
|
||||
let _ = self.save_state(&std::path::Path::new(&dir));
|
||||
let _ = self.save_state(std::path::Path::new(&dir));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user