Skip to content

All bit twiddling functions in num::traits::PrimInt should take or return usize instead of u32 #14

Closed
@cuviper

Description

@cuviper

From @octurion on April 10, 2015 10:12

The trait num::traits::PrimInt mandates that any type implementing it must also implement Shl<usize, Output=Self> and Shr<usize, Output=Self> (in other words, PrimInt mandates that the shift amount be of type usize).

Thus all bit twiddling functions (trailing_zeros, rotate_left, count_zeros etc.) in PrimInt should take or return a usize instead of u32 as the number of bits for the sake of consistency with what the implementation restrictions on Shl and Shr mandate.

Copied from original issue: rust-num/num#80

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions