Skip to content

Instantly share code, notes, and snippets.

@rust-play
Created January 11, 2019 18:53
Show Gist options
  • Save rust-play/236ce9187bc35a817ad5b523907ca9b3 to your computer and use it in GitHub Desktop.
Save rust-play/236ce9187bc35a817ad5b523907ca9b3 to your computer and use it in GitHub Desktop.
Code shared from the Rust Playground
const fn true_fn() -> bool { true }
fn main() -> Result<(), Box<std::error::Error>> {
let num = true;
const TRUE: bool = true_fn();
match num {
TRUE => println!("Is u64::max_value()"),
false => println!("Is boring")
}
Ok(())
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment