tisonkun commented on code in PR #211:
URL: https://github.com/apache/datasketches-rust/pull/211#discussion_r3848755772
##########
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:
We should improve this doc; at least we should not suddenly tell `#192` or
similar thing that is too detailed.
--
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]