tustvold commented on code in PR #3818:
URL: https://github.com/apache/arrow-rs/pull/3818#discussion_r1131317949
##########
arrow-data/src/data/primitive.rs:
##########
@@ -145,13 +208,10 @@ impl<T: Primitive> PrimitiveArrayData<T> {
values: ScalarBuffer<T>,
nulls: Option<NullBuffer>,
) -> Self {
- let physical = PhysicalType::from(&data_type);
- assert!(
- matches!(physical, PhysicalType::Primitive(p) if p == T::TYPE),
- "Illegal physical type for PrimitiveArrayData of datatype {:?},
expected {:?} got {:?}",
- data_type,
- T::TYPE,
- physical
+ assert_eq!(
+ PhysicalType::from(&data_type),
+ PhysicalType::Primitive(T::TYPE),
+ "Illegal physical type for PrimitiveArrayData of datatype
{data_type:?}",
Review Comment:
Using assert_eq means it will render the `expected {:?} got {:?}` part
automatically
--
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]