Skip to content

Commit

Permalink
Rollup merge of rust-lang#74390 - ColoredCarrot:patch-1, r=lcnr
Browse files Browse the repository at this point in the history
Fix typo in std::mem::transmute documentation

`u32::from_ge_bytes` function does not exist; replace with `u32::from_be_bytes`.
It is clear that `u32::from_le_bytes` is not meant from the context; the latter is used correctly while `from_be_bytes` is misspelled.
  • Loading branch information
Manishearth committed Jul 16, 2020
2 parents 1be5cef + 593c7fe commit d714b16
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/libcore/intrinsics.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1126,7 +1126,7 @@ extern "rust-intrinsic" {
///
/// // use `u32::from_ne_bytes` instead
/// let num = u32::from_ne_bytes(raw_bytes);
/// // or use `u32::from_le_bytes` or `u32::from_ge_bytes` to specify the endianness
/// // or use `u32::from_le_bytes` or `u32::from_be_bytes` to specify the endianness
/// let num = u32::from_le_bytes(raw_bytes);
/// assert_eq!(num, 0x12345678);
/// let num = u32::from_be_bytes(raw_bytes);
Expand Down

0 comments on commit d714b16

Please sign in to comment.