From eff7d568d820a07d621bac85502d6236103ca908 Mon Sep 17 00:00:00 2001 From: Lzu Tao Date: Thu, 6 Aug 2020 07:33:07 +0000 Subject: [PATCH] Note about endianness of returned value in {integer}::from_be_bytes and friends. --- library/core/src/num/mod.rs | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/library/core/src/num/mod.rs b/library/core/src/num/mod.rs index eb50dc28b9f..95eae7e2a73 100644 --- a/library/core/src/num/mod.rs +++ b/library/core/src/num/mod.rs @@ -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, " @@ -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, " @@ -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