This commit is contained in:
Jessie
2023-09-21 23:52:00 -04:00
parent 18383c9e20
commit ac89ef0821
2 changed files with 153 additions and 9 deletions

View File

@@ -0,0 +1,24 @@
use anything::{Anything, Nothing};
pub fn func_1() -> Result<(),Anything> {
Err(())?;
Ok(())
}
pub fn func_2() -> Result<(),Anything> {
Err("Hello World")?;
Ok(())
}
pub fn func_3() -> Result<(),Nothing> {
Err("Hello World")?;
Ok(())
}
#[test]
pub fn test() {
println!("{:?}", func_1().unwrap_err());
println!("{:?}", func_2().unwrap_err());
println!("{:?}", func_3().unwrap_err());
}