alamb commented on code in PR #7027:
URL: https://github.com/apache/arrow-rs/pull/7027#discussion_r1930266601
##########
arrow-data/src/data.rs:
##########
@@ -1779,6 +1783,34 @@ impl PartialEq for ArrayData {
}
}
+mod private {
+ /// A boolean flag that cannot be mutated outside of unsafe code.
+ ///
+ /// Defaults to a value of false.
+ ///
+ /// This structure is used to enforce safety in the [`ArrayDataBuilder`]
+ #[derive(Debug)]
+ pub struct UnsafeFlag(bool);
+
+ impl UnsafeFlag {
+ /// Creates a new `UnsafeFlag` with the value set to `false`
+ #[inline]
+ pub const fn new() -> Self {
+ Self(false)
+ }
+
+ #[inline]
Review Comment:
the point of structure is that the compiler enforces it can only ever be set
to true via unsafe code
--
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]