Created
February 12, 2016 00:18
-
-
Save anonymous/94bc2cad59a61a83ddcb to your computer and use it in GitHub Desktop.
Shared via Rust Playground
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| fn main() { | |
| // isize to usize | |
| let x: isize = -1; | |
| println!("-1 as usize: {:?}", x as usize); | |
| // but u8 to i8 | |
| let y: u8 = 255; | |
| println!("255 as i8: {:?}", y as i8); | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment