Skip to content

Conversation

EricccTaiwan
Copy link
Contributor

Initialize raw_capacity only when needed to avoid warning.

Ref: #1893

Log:

warning: value assigned to `raw_capacity` is never read
   --> rust/scx_utils/src/topology.rs:606:13
    |
606 |     let mut raw_capacity = 0;
    |             ^^^^^^^^^^^^
    |
    = help: maybe it is overwritten before being read?
    = note: `#[warn(unused_assignments)]` on by default

warning: `scx_utils` (lib) generated 1 warning

Initialize `raw_capacity` only when needed to avoid warning.

Ref: sched-ext#1893

Signed-off-by: Cheng-Yang Chou <[email protected]>
Copy link
Contributor

@multics69 multics69 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good catch!

@multics69 multics69 added this pull request to the merge queue May 17, 2025
Merged via the queue into sched-ext:main with commit 92c5d06 May 17, 2025
16 checks passed
@EricccTaiwan EricccTaiwan deleted the utils-warning branch May 17, 2025 14:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants