Clarify wording in transmute
example
* Change "four eights" to "four u8s" * Change "a 32" to "a u32"
This commit is contained in:
parent
2fb6f8e2c9
commit
345626f088
1 changed files with 2 additions and 2 deletions
|
@ -135,14 +135,14 @@ cast four bytes into a `u32`:
|
|||
```rust,ignore
|
||||
let a = [0u8, 0u8, 0u8, 0u8];
|
||||
|
||||
let b = a as u32; // four eights makes 32
|
||||
let b = a as u32; // four u8s makes a u32
|
||||
```
|
||||
|
||||
This errors with:
|
||||
|
||||
```text
|
||||
error: non-scalar cast: `[u8; 4]` as `u32`
|
||||
let b = a as u32; // four eights makes 32
|
||||
let b = a as u32; // four u8s makes a u32
|
||||
^~~~~~~~
|
||||
```
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue