HaoYang670 commented on code in PR #2405:
URL: https://github.com/apache/arrow-rs/pull/2405#discussion_r943043549
##########
arrow/src/util/decimal.rs:
##########
@@ -114,17 +113,17 @@ impl<const BYTE_WIDTH: usize> BasicDecimal<BYTE_WIDTH> {
/// Creates a decimal value from precision, scale, and bytes.
///
/// Safety:
- /// This method doesn't check if the length of bytes is compatible with
this decimal.
+ /// This method doesn't check if the precision and scale are valid.
/// Use `try_new_from_bytes` for safe constructor.
- pub fn new(precision: usize, scale: usize, bytes: &[u8]) -> Self {
+ pub fn new(precision: usize, scale: usize, bytes: &[u8; BYTE_WIDTH]) ->
Self {
Review Comment:
I am not sure if we should make this as an unsafe function.
--
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]