Skip to content

ThreadPriorityValue::MIN/ThreadPriorityValue::MAX have unexpected types #38

@nazar-pc

Description

@nazar-pc

I believe those should have ThreadPriorityValue type, not u8. It is always possible to convert it to u8 later if desired, but converting u8 to ThreadPriorityValue requires unwrap() or expect(), which is inconvenient and unnecessary.

P.S. Clippy warning here has nothing to do with From<u8>, it suggests you to do impl From<ThreadPriorityValue> for u8:

thread-priority/src/lib.rs

Lines 264 to 271 in 74cf570

// The From<u8> is unsafe, so there is a TryFrom instead.
// For this reason we silent the warning from clippy.
#[allow(clippy::from_over_into)]
impl std::convert::Into<u8> for ThreadPriorityValue {
fn into(self) -> u8 {
self.0
}
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions