You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Currently, there are two separate implementations for iterating over a slice of u64 in big-endian and little-endian order, namely BitIteratorBE and BitIteratorLE. These implementations have similar functionalities but are implemented separately. This proposal suggests unifying them into a single implementation with an Endian enum to denote whether the iteration should be in big-endian or little-endian order.
Proposed Changes
Introduce an Endian enum with variants big and little.
Modify the iterator implementations to handle both big-endian and little-endian orders based on the value of the Endian enum.
Example Usage
useEndian::*;// Usage example with the Endian enumletmut iter = BitIterator::new(&data,Endian::big);// Big-endian orderletmut iter = BitIterator::new(&data,Endian::little);// Little-endian order
Benefits
Simplifies the codebase by removing duplicate implementations.
Provides a more consistent and unified interface.
Allows for easy specification of the endianness using the Endian enum.
The text was updated successfully, but these errors were encountered:
Description
Currently, there are two separate implementations for iterating over a slice of
u64
in big-endian and little-endian order, namelyBitIteratorBE
andBitIteratorLE
. These implementations have similar functionalities but are implemented separately. This proposal suggests unifying them into a single implementation with anEndian
enum to denote whether the iteration should be in big-endian or little-endian order.Proposed Changes
Endian
enum with variantsbig
andlittle
.Endian
enum.Example Usage
Benefits
Endian
enum.The text was updated successfully, but these errors were encountered: