Clippy Tracking Issue: clippy::same_length_and_capacity (pedantic)
Nobody has claimed this yet.
Assessment
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Newbie friendliness
- 64/100
- Issue type
- Refactor
- Clarity
- Mostly clear
- Activity status
- Quiet
- Tech stack
- rust
- Domain
- embedded-iot
Research direction
Start in sdk/patina/src/pi/hob/hob_list.rs at the manually_free_c_array function and inspect the temporary clippy::same_length_and_capacity allowance. Check current Clippy behavior, then remove the allowance when the lint no longer requires it. Run the relevant Rust checks or Clippy validation to confirm the file remains clean.
Written by the indexing model from the issue text.
Description
Documentation: clippy::same_length_and_capacity
Current Status: There is a temporary allowance in sdk/patina/src/pi/hob/hob_list.rs that needs follow up:
// Implements a function to manually free a C array.
//
// # Arguments
// * `c_array_ptr` - A pointer to the C array.
// * `len` - The length of the C array.
//
// # Safety
//
// The caller must ensure that the pointer and length match a Vec originally created by to_c_array.
pub fn manually_free_c_array(c_array_ptr: *const c_void, len: usize) {
let ptr = c_array_ptr as *mut u8;
// SAFETY: Caller is responsible for ensuring the pointer and length are valid per the function contract.
unsafe {
#[allow(clippy::same_length_and_capacity)]
// TODO: Remove this once the clippy lint is fixed in the future.
drop(Vec::from_raw_parts(ptr, len, len));
}
}
- Dominant language
- Rust
- Stars
- 544
- Forks
- 54
- Avg merge
- 1d 8h
- Merged PRs (30d)
- 30
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from OpenDevicePartnership/patina
-
state:needs-triage type:documentation
Difficulty 1/5 Under an hour Newbie friendliness 65/100
OpenDevicePartnership/patina#1420 ·
-
state:needs-triage type:feature-request urgency:medium
OpenDevicePartnership/patina#1783 · 1 assignee ·
-
type:bug urgency:low
OpenDevicePartnership/patina#1748 · 3 comments · 1 assignee ·
-
state:backlog
Difficulty 4/5 3-5 days Newbie friendliness 45/100
OpenDevicePartnership/patina#1737 ·
-
state:backlog
Difficulty 4/5 3-5 days Newbie friendliness 35/100
OpenDevicePartnership/patina#1735 ·
All issues in OpenDevicePartnership/patina
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
Eynzof/Hermes-CN-Desktop#610 ·
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
gitbutlerapp/gitbutler#15998 · 1 comment ·
-
bug triage:deciding
Difficulty 1/5 Under an hour Newbie friendliness 88/100
open-telemetry/otel-arrow#4132 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 84/100