tisonkun commented on code in PR #211:
URL: https://github.com/apache/datasketches-rust/pull/211#discussion_r3848833265


##########
datasketches/src/thetafamily/theta/intersection.rs:
##########
@@ -75,16 +75,15 @@ impl ThetaIntersection {
 
     /// Returns the intersection result as a compact theta sketch.
     ///
-    /// # Panics
-    ///
-    /// Panics if called before the first [`update`](Self::update).
-    pub fn to_sketch(&self, ordered: bool) -> CompactThetaSketch {
-        assert!(
-            self.state.has_result(),
-            "ThetaIntersection::to_sketch() called before first update()"
-        );
+    /// Returns `None` if called before the first [`update`](Self::update).
+    /// Absence of a result is part of the public state machine; use
+    /// [`has_result`](Self::has_result) or this `Option` return instead of 
panicking (#192).

Review Comment:
   Addressed in d1aaa26. I rewrote the Theta and Tuple docs around the 
observable contract: a new intersection returns `None`; after a successful 
update it returns `Some`, including when the intersection is empty. I also 
removed the issue reference and aligned the stale Theta test name.



-- 
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]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to