common/emgauwa-core/src/utils.rs

8 lines
160 B
Rust
Raw Normal View History

2023-12-04 22:59:26 +00:00
pub fn flatten_result<T, E>(res: Result<Result<T, E>, E>) -> Result<T, E> {
match res {
Ok(Ok(t)) => Ok(t),
Ok(Err(e)) => Err(e),
Err(e) => Err(e),
}
}