core/src/utils.rs
Tobias Reisinger b742f0f8d6
Some checks failed
/ build-artifacts (arm-unknown-linux-gnueabihf) (push) Failing after 9m27s
Split project (keep core)
2024-04-30 10:38:01 +02:00

7 lines
160 B
Rust

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),
}
}