fn main() {
let res = funny();
let res = funny();
match res {
Ok(i) => {},
Err(ref s) => {}
};
match res {
Ok(i) => {},
Err(ref s) => {}
};
}
fn funny() -> Result<i32, String> {
Ok(10)
}
가능한 반환 값이 3가지면 Result<T1, Result<T2, T3>>처럼 겹치면 돼
이런 경우에는 Either를 쓰도록 하자 - dc App