tobixdev commented on code in PR #8829:
URL: https://github.com/apache/arrow-rs/pull/8829#discussion_r2527840698
##########
arrow-cast/src/display.rs:
##########
@@ -82,6 +91,43 @@ impl Default for FormatOptions<'_> {
}
}
+impl PartialEq for FormatOptions<'_> {
+ fn eq(&self, other: &Self) -> bool {
+ self.safe == other.safe
+ && self.null == other.null
+ && self.date_format == other.date_format
+ && self.datetime_format == other.datetime_format
+ && self.timestamp_format == other.timestamp_format
+ && self.timestamp_tz_format == other.timestamp_tz_format
+ && self.time_format == other.time_format
+ && self.duration_format == other.duration_format
+ && match (self.formatter_factory, other.formatter_factory) {
+ (Some(f1), Some(f2)) => std::ptr::eq(f1, f2),
+ (None, None) => true,
+ _ => false,
+ }
+ }
+}
+
+impl Eq for FormatOptions<'_> {}
+
+impl Hash for FormatOptions<'_> {
+ fn hash<H: Hasher>(&self, state: &mut H) {
+ self.safe.hash(state);
+ self.null.hash(state);
+ self.date_format.hash(state);
+ self.datetime_format.hash(state);
+ self.timestamp_format.hash(state);
+ self.timestamp_tz_format.hash(state);
+ self.time_format.hash(state);
+ self.duration_format.hash(state);
+ self.types_info.hash(state);
Review Comment:
Thank you for catching that!
--
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]