Skip to content

Instantly share code, notes, and snippets.

@Dustin4444
Forked from rust-play/playground.rs
Last active April 6, 2026 01:09
Show Gist options
  • Select an option

  • Save Dustin4444/89bec79d99b714ccf0d5b7849bc02753 to your computer and use it in GitHub Desktop.

Select an option

Save Dustin4444/89bec79d99b714ccf0d5b7849bc02753 to your computer and use it in GitHub Desktop.
Code shared from the Rust Playground
#![crate_type = "cdylib"]
#![allow(unused)]
fn main() {
let x: Result<i32, &str> = Ok(-3);
assert_eq!(x.is_ok(), true);
let x: Result<i32, &str> = Err("Some error message");
assert_eq!(x.is_ok(), false);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment