Skip to content

Instantly share code, notes, and snippets.

@rust-play
Created August 25, 2019 17:09
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save rust-play/de7e56e9e12c813ba9174ea836db6ed2 to your computer and use it in GitHub Desktop.
Save rust-play/de7e56e9e12c813ba9174ea836db6ed2 to your computer and use it in GitHub Desktop.
Code shared from the Rust Playground
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