2020-04-14 10:31:59 -05:00
|
|
|
fn main(){ }
|
|
|
|
|
|
|
|
fn test_result() -> Result<(),()> {
|
|
|
|
let a:Option<()> = Some(());
|
2021-04-17 13:56:07 -05:00
|
|
|
a?;//~ ERROR the `?` operator can only be used
|
2020-04-14 10:31:59 -05:00
|
|
|
Ok(())
|
|
|
|
}
|
|
|
|
|
|
|
|
fn test_option() -> Option<i32>{
|
|
|
|
let a:Result<i32, i32> = Ok(5);
|
2021-04-17 13:56:07 -05:00
|
|
|
a?;//~ ERROR the `?` operator can only be used
|
2020-04-14 10:31:59 -05:00
|
|
|
Some(5)
|
|
|
|
}
|