mozilla/rust — pull request #14917 by bjz (2014-06-15 17:49:35+00:00)
Title: Group endian conversion functions in a single trait

The free-standing endian conversion functions have been deprecated in favour of a group of conversion functions grouped together in a new `core::mem::ByteOrder` trait. These methods have longer, more descriptive names to distinguish them from those defined on the `PartialOrd` trait:

- `from_be` -> `ByteOrder::from_big_endian`
- `from_le` -> `ByteOrder::from_little_endian`
- `to_be` -> `ByteOrder::to_big_endian`
- `to_le` -> `ByteOrder::to_little_endian`

The `Bitwise::swap_bytes` method was also moved into the `ByteOrder` trait. This was because it works on the byte level rather than the bit level.