Created
August 25, 2019 17:09
-
-
Save rust-play/de7e56e9e12c813ba9174ea836db6ed2 to your computer and use it in GitHub Desktop.
Code shared from the Rust Playground
This file contains 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
use std::convert::TryInto; | |
fn main() { | |
let x: i64 = -30; | |
let y: u64 = x.try_into().unwrap(); | |
println!("{}", y); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment