24 lines
425 B
Rust
24 lines
425 B
Rust
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());
|
|
} |