tustvold commented on code in PR #6612:
URL: https://github.com/apache/arrow-rs/pull/6612#discussion_r1822413359
##########
parquet/src/errors.rs:
##########
@@ -107,6 +107,13 @@ impl From<str::Utf8Error> for ParquetError {
}
}
+#[cfg(test)]
+impl From<std::convert::Infallible> for ParquetError {
Review Comment:
> aka to transform a Result<.., Infallible> to Result<.., Error> type
expected by an API)
Right but this is a little funky, because it then makes code look more
fallible than it is. Often you can use an infallible version of the API, i.e.
`into()` instead of `try_into()`, but sometimes you do have to either
`unwrap()` or `let _ = ...`
FWIW Rust 1.82 gives us a very nice way to handle this, but I'm not sure
whether our MSRV policy covers tests.
```
let Ok(value) = expression();
```
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]