This commit is contained in:
sharkdp 2018-09-26 19:13:32 +02:00
parent 3456ce1187
commit 64903bb858

View file

@ -77,7 +77,7 @@ fn is_truecolor_terminal() -> bool {
.unwrap_or(false)
}
/// Helper function that should might appear in Rust stable at some point
/// Helper function that might appear in Rust stable at some point
/// (https://doc.rust-lang.org/stable/std/option/enum.Option.html#method.transpose)
fn transpose<T>(opt: Option<Result<T>>) -> Result<Option<T>> {
opt.map_or(Ok(None), |res| res.map(Some))