scovich commented on code in PR #8357:
URL: https://github.com/apache/arrow-rs/pull/8357#discussion_r2354150806
##########
parquet-variant/src/utils.rs:
##########
@@ -144,3 +144,20 @@ pub(crate) const fn expect_size_of<T>(expected: usize) {
let _ = [""; 0][size];
}
}
+
+pub(crate) fn fits_precision<const N: u32>(n: impl Into<i64>) -> bool {
Review Comment:
It was mostly out of habit for small integer manipulation utilities... But
now that you mention, it probably doesn't matter in the slightest -- the
compiler will anyway inline aggressively and the constant arg will be folded in
regardless of whether it's a generic arg or a function arg.
That said, there's one potential advantage to keeping the generic arg:
Otherwise, it could be ambiguous which of two integer args is the precision and
which is the actual value. Any preferences?
--
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]