Skip to content

Note about endianness of returned value of {integer}::from_be_bytes and friends #75211

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Aug 7, 2020
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
12 changes: 6 additions & 6 deletions library/core/src/num/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4383,8 +4383,8 @@ assert_eq!(
}

doc_comment! {
concat!("Create an integer value from its representation as a byte array in
big endian.
concat!("Create a native endian integer value from its representation
as a byte array in big endian.
",
$from_xe_bytes_doc,
"
Expand Down Expand Up @@ -4416,8 +4416,8 @@ fn read_be_", stringify!($SelfT), "(input: &mut &[u8]) -> ", stringify!($SelfT),

doc_comment! {
concat!("
Create an integer value from its representation as a byte array in
little endian.
Create a native endian integer value from its representation
as a byte array in little endian.
",
$from_xe_bytes_doc,
"
Expand Down Expand Up @@ -4448,8 +4448,8 @@ fn read_le_", stringify!($SelfT), "(input: &mut &[u8]) -> ", stringify!($SelfT),
}

doc_comment! {
concat!("Create an integer value from its memory representation as a byte
array in native endianness.
concat!("Create a native endian integer value from its memory representation
as a byte array in native endianness.

As the target platform's native endianness is used, portable code
likely wants to use [`from_be_bytes`] or [`from_le_bytes`], as
Expand Down