Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 20 additions & 4 deletions library/core/src/num/int_macros.rs
Original file line number Diff line number Diff line change
Expand Up @@ -372,6 +372,8 @@ macro_rules! int_impl {
///
/// On big endian this is a no-op. On little endian the bytes are swapped.
///
/// See also [from_be_bytes()](Self::from_be_bytes).
///
/// # Examples
///
/// ```
Expand Down Expand Up @@ -402,6 +404,8 @@ macro_rules! int_impl {
///
/// On little endian this is a no-op. On big endian the bytes are swapped.
///
/// See also [from_le_bytes()](Self::from_le_bytes).
///
/// # Examples
///
/// ```
Expand All @@ -428,9 +432,15 @@ macro_rules! int_impl {
}
}

/// Converts `self` to big endian from the target's endianness.
/// Swaps bytes of `self` on little endian targets.
///
/// On big endian this is a no-op. On little endian the bytes are swapped.
/// On big endian this is a no-op.
///
/// The returned value has the same type as `self`, and will be interpreted
/// as (a potentially different) value of a native-endian
#[doc = concat!("`", stringify!($SelfT), "`.")]
///
/// See [`to_be_bytes()`](Self::to_be_bytes) for a type-safe alternative.
///
/// # Examples
///
Expand Down Expand Up @@ -459,9 +469,15 @@ macro_rules! int_impl {
}
}

/// Converts `self` to little endian from the target's endianness.
/// Swaps bytes of `self` on big endian targets.
///
/// On little endian this is a no-op. On big endian the bytes are swapped.
/// On little endian this is a no-op.
///
/// The returned value has the same type as `self`, and will be interpreted
/// as (a potentially different) value of a native-endian
#[doc = concat!("`", stringify!($SelfT), "`.")]
///
/// See [`to_le_bytes()`](Self::to_le_bytes) for a type-safe alternative.
///
/// # Examples
///
Expand Down
Loading